Python屬高階語言,所編築的是字節碼
變量;只能由字母、數字、下划線構成,但不能以數字開頭,亦不能與功能關鍵字相同
(ex: and, or, as, assert, break, class, continue, def, del, elif, else, if ,expect, exec, finally, for ,in, while, from, global, import, input, print, is, not ,pass, return, try, with, yeild)
計算符
7 + 3 = 10
7 - 3 = 5
7 * 3 = 21
7 / 3 = 2.33333333
7 // 3 = 2 (商)
7 % 3 = 1 (餘)
7 ** 3 = 343 (方)
關係符
< (小於) <= (小於等於) == (等於) >= (大於等於) > (大於) != or <> (不等於)
K = 1 (令K為1) K == 1 (K與1相同 / 比較用)
條件語句
If elif elif else
判定結果為 True/False (bool值)
支援 [Pass in not in]
有關係符 ( < (小於) <= (小於等於) == (等於) >= (大於等於) > (大於) != or <> (不等於) )
name = "ABC" 其字符串的子序列 "A" "B" "C" "AB" "BC" "ABC" 都可被 in 判定為 True,但字符串內部為有序,故"AC"則為False
迭代循環
While 循環 (無限循環,可加上終止條件語句)
支援 [ 條件If Pass continue(跳回上層循環) break(直接終止循環) ]
For ____ in ____ 循環
原文地址:https://www.cnblogs.com/pyleu1028/p/9882111.html