变量
声明变量
name = 'ajune'
变量赋值
name = 'ajune'
name1 = name
变量定义的规则:
变量名只能是 字母、数字或下划线的任意组合
变量名的第一个字符不能是数字...'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield']
输入...input()将接收的内容转为string类型
可以使用int()将内容转为int型
导入getpass模块,适用于输入密码
?...import getpass
getpass.getpass() # 输入密码时能接收但不可见
View Code
输出
可以使用print()进行输出内容
print('hellow,world...21
%占位符连接 name = ajune age = 21
format连接 name = ajune age = 21
format加号连接 name = ajune age = 21
判断
Python