转换为整形int
num = int(“123”) 123
num2 = int(123.45) 123
浮点型float:
字符串转浮点型 num3 = float(“123.45”) 123.45
函数math.floor()
函数round()
函数math.modf
字符串型str:
str1 = str(123) “123”
转换为整形int
num = int(“123”) 123
num2 = int(123.45) 123
浮点型float:
字符串转浮点型 num3 = float(“123.45”) 123.45
函数math.floor()
函数round()
函数math.modf
字符串型str:
str1 = str(123) “123”