代码示例:(标识:python_casting_string)
python_casting_string.py
x = str("S2")
y = str(3)
z = str(4.0)
print(x)
print(y)
print(z)
运行结果: