Python 的数据类型
Jason Myers
Instructor
TrueFalse注意大小写;在 Python 与其他语言间切换时易出错。
out_of_cookies = True
if out_of_cookies:
print("Run to the store NOW!")
Run to the store NOW!
apples=2
if apples:
print("We have apples.")
"We have apples."
apples=0
if apple:
print('We have apples.')
1"Cookies"["Cake", "Pie"]{"key": "value"}0""[]{}Nonecookie_qty == 3
== 等于!= 不等于< 小于<= 小于等于> 大于>= 大于等于x = 0.1 + 1.1
x == 1.2
False
print(x)
1.2000000000000002
比较浮点数是否相等要小心!
Python 的数据类型