代码示例:(标识:python_numbers_convert)
python_numbers_convert.py
#convert from int to float:
x = float(10)

#convert from float to int:
y = int(6.3)

#convert from int to complex:
z = complex(x)

print(x)
print(y)
print(z)
运行结果: