get paid

Get paid for the tasks you do online

2019年1月23日 星期三

python ZIP 小技巧

zip 是 python 很好用但 用的人卻不多的function

寫 python 時我常常用 zip 把兩個 list 合併成一個 dict ..
 dict 要查群時 會方便很多


hours = [x for x in range(0,24)]

Counts = [int(0) for x in range(0,24)]
hourUpCounts = dict(zip(hours,Counts))
hourDownCounts = dict(zip(hours,Counts))
hourSpeed = dict(zip(hours,Counts))

沒有留言:

張貼留言

ChartGPT 學 python 很強喔

 ChartGPT 最近很紅 ,  前一陣子有一些小 module  本來想 google  一下 語法 但發現用 chartGPT 直接請他給 sample code 反而較快 所以只要你有基本 知識 ChartGPT 可以加速你的開發 好用喔