在Python中,可对整数执行加、减、乘、除、取余、地板除运算
在Python中将带小数点的数字都称为浮点数
在Python中用引号(单引号或双引号)包括的字符称为字符串
# 整数 To 浮点数 number = 520 print (number) print (float (number))
# 浮点数 To 整数 number = 520.0 print (number) print (int (number))
# 数字 To 字符串 number = 520.0 number1 = 520 print (type (number)) print (number) print (number1) print (type (str (number))) print (str (number)) print (str (number1))
# 字符串 To 数字 str = '520' print (type (str)) print (str) print (type (int (str))) print (int (str)) print (type (float (str))) print (float (str))