变量定义:在python中,存储一个数据,需要一个叫做变量的东西
标识符的命名规则:标识符只能由字母、下划线’_’、数字组成
标识符不能以数字开头
标识符不能使用关键字
关键字有:false none true and as assert break class continue def del elif
else except finally for from global if import in is lambda nonlocal not or pass return try while with yield
\n是换行 \t是空格
运算符:赋值运算符:+=:加法 -=:减法 *=:乘法 /=:除法 %=:取模赋值 **=:次幂 //=:取整除赋值
逻辑运算符:and:与 or:或 not:非
小驼峰命名法:
大驼峰命名法:
数据类型转换
input输入,格式化输出
if 判断
if 练习 和运算符
python 基础
最新推荐文章于 2024-07-19 16:36:18 发布