Python基礎(四)- 函數

函數 有兩種類型的函數:一種設計成返回值,一種僅執行代碼而不返回值。 內建函數 之前接觸到的函數: 函數 例子 結果 輸入 輸出 int int(2.6) 2 數字 數字 chr chr(65) ‘A’ 數字 字符串 ord ord(‘A’) 65 字符串 數字 round round(2.34,1) 2.3 數字, 數字 數字 用戶自定義函數 def functionName(par1,par2
相關文章
相關標籤/搜索