在2.7中
input输入的数值
raw_input输入的事字符串
或者把输入的内容用引号扩起来
deathage = 80
name = raw_input("your name:")
age = input("your age:")
print "hi,",name,"your age is ",age,"now."
print "you can still live for ",deathage-age," years."
在3.5中
input输入的都是字符串
数值要在输入后转化成数值类型:
deathage = 80
name = input("your name:")
age = input("your age:")
print "hi,",name,"your age is ",age,"now."
print "you can still live for ",deathage-int(age)," years."