算术运算符
+ - * / % ** //
判断某个东西是否在某个东西里面包含
in not in
逻辑运算符
and or not
比较运算符
== > < >= <= !=
布尔值
True False
乘方 **
num = 9 ** 2
print(num) # 81
求数 /
num = 9 / 2
print(num) # 4.5
求商 //
num = 9 // 2
print(num) # 4
in
name = "Hello"
if "H" in name:
print("ok")
else:
print("not ok") # ok
网友评论