标签:交互 nbsp raw_input 内容 不能 用户交互 级别 变量 划线
---恢复内容开始---
变量起名
变量名只能是字母.数字.下划线的任意组合。
变量名的第一个字符不能是数字。
关键字不能声明为变量。
变量名不能有空格.特殊字符。
用户交互
name = input(“please input your name:”) #3.0版本input输出为字符串格式。
2.0版本 3.0版本
input = evel(input)
raw_input = input
if....else条件判断与缩进
num = input (‘Enter a number:’)
if num > 0 :
print ‘the number is positive‘
elif num < 0:
print ‘the number is negative‘
else:
print ‘the number is zero‘
缩进官方建议为四个空格.区分字符串级别。
---恢复内容结束---
标签:交互 nbsp raw_input 内容 不能 用户交互 级别 变量 划线
原文地址:http://www.cnblogs.com/Donald-92/p/7425280.html