[筆記] Python - 基本語法

 print 搭配 %s %d %f



print 搭配間隔字、結束字


print 搭配 format





變數定義數字、布林、字串
















確認資料型態 type(...)


判斷式 if else

list [... , ...]













range(開始, 結束, 間隔): 由 list 組成















list 重複










切片取值








刪除元素 del








len、min、max、index、count


aappend、extend、insert


pop、remove


reverse、sort



Tuple(... , ...):不能修改的List,執行速度比list快,儲存在Tuple的資料比較安全


dict (字典)


字典刪除元素、清空、刪除字典

for 迴圈







while 迴圈




function




function 參數不定







dfunction 參數為函式





常用內建函式



2

留言

這個網誌中的熱門文章

[筆記] Python - 網路爬蟲 Goodinfo 股市

步進馬達與伺服馬達介紹與差異

[筆記] 批次檔的應用 - visual studio 編譯