- 单行注释:用#
- 多行注释:用 ’ ’ ‘被注释的内容’ ’ ’ 或者 " " “被注释的内容” " "
注意:input接收的所有数据类型都是字符串,即便你输入的是数字,但仍然会被当做字符串处理
- int:整数 把字符串转成int类型int(被转换的数据)
- str:字符串 把数据类型转成字符串str(被转换的数据)
- (type(age)) 查看数据类型type(要查看的数据)
death_age = 80
name = input("your name:")
age = input("your age:")
print("You can still live for", str(death_age - int(age)),"years...")