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 的資料型別