📅  最后修改于: 2022-03-11 14:46:35.903000             🧑  作者: Mango
# This kind of conversion of types is known as type casting
# Type of variable can be determined using this function type(variable)
>>> string = '123'
>>> type(string) # Getting type of variable string
>>> integer = int(string) # Converting str to int
>>> type(integer)
>>> float_number = float(string) # Converting str to float.
>>> type(float_number)
>>> print(string, integer, float_number)
123 123 123.0