标签:nbsp inpu ring nan str string put 转换 input
death_age =80
name = input("your nane:")
age = input("your age:") #input 接受的所有数据都是字符串,但是会被当成字符串来处理
print (type(age)) #打印数据类型
#int integer =整数 把字符串转出数据用int(被转数据)
#str string =字符串 把数据转成字符串用str(被转数据)
print("your name:",name )
print("you can still live for ",str (death_age - int(age) ),"years ...." )
print("you can still live for " + str (death_age - int(age) ) + "years ...." )
标签:nbsp inpu ring nan str string put 转换 input
原文地址:https://www.cnblogs.com/q402599/p/10324183.html