Python中的經常使用函數方法

類型轉換 函數 描述 例子 int(x [,base]) 將x轉換爲一個整數,base可選,進制,默認爲十進制 float(x) 將x轉換到一個浮點數 complex(real [,imag]) 建立一個複數 complex(1, 2) -> (1 + 2j) str(x) 將對象 x 轉換爲字符串 tuple(s) 將序列 s 轉換爲一個元組 list(s) 將序列 s 轉換爲一個列表 set(
相關文章
相關標籤/搜索