代码示例:(标识:python_casting_int)
python_casting_int.py
x = int(1)
y = int(2.5)
z = int("3")
print(x)
print(y)
print(z)
运行结果: