運算子 A**B #A的B次方 註解 # #單行註解 """ #多行註解 and or not 優先順序 not > and > or IF ELSE 用縮排來判斷是不是在if,而不是用大括號。 elif == else if In C if (condition) { ... }else if (condition){ ... }else{ ... } In Python if (condition) : ... elif (condition) : ... else: ... Function In C #用大括號來判別是不是這個function的內容 int function(parameter){ .... .... } In Python #用縮進來判別是不是這個function的內容 def function(parameter): .... .... Anonymous Functions 使用方法: lambda 回傳值 : 程式碼 常用: print filter(lambda 回傳值 : 程式碼, list) lambda x: x % 3 == 0 相等於 def by_three (x) : return x % 3 == 0 import In C #include <something> In Python import somthing function import from module import function from moudle import * 用索引存取字串 ( Access by Index ) varName = "cats"[0] #把cats中第0個元素('c')放到varName變數中 == "cats"[0:1]。 varName = "cats"[1:3] #從cats中位置1開始抓元素直到位置3之前(at)。 字串函數 len(strName) #長度 .lower() #小寫化 .upper() #大寫化 str(dataName) #字串化 print strN...