寫code玩youbike即時資訊
0. 用python(程式語言)寫code(程式碼)
得上python官網python.org下載安裝python的IDE(整合開發環境)
或用一些web的IDE來開發例如codepad.org
或我們今天要用的遠端面試用的codepad.remoteinterview.io
請開一個codepad將短網址貼這裡好讓大家可以review你的code幫你debug
https://codepad.remoteinterview.io/ResoluteStarryAustinMemphis 百千
https://codepad.remoteinterview.io/NostalgicShakingRegularRavioli Yang
https://codepad.remoteinterview.io/FolksyManlinessMagnumTalent 柏睿
https://codepad.remoteinterview.io/PuzzledJokingCloneCobalt 二?
https://codepad.remoteinterview.io/ManiacalLightheartedPhoneKansas zzz
1. 簡單、優美、強大
- 用變數存放資料,等號右邊的資料存入等號左邊的變數
- 常用的資料型態有:整數/int、字串/str、串列/list、字典/dict
- 用print指令輸出在螢幕上
- 用type函數取得資料型態然後print
- 用#寫註解,方便自己或別人理解
- 若程式裡面有中文字串或註解,第一行必須是 # coding:utf-8
- 用一些基本運算改變變數
- 用 if 寫流程
- 用 for 寫迴圈
2. data.taipei 搜尋youbike
下載的是JSON格式的純文字檔案,用右鍵Open with Atom看看
https://github.com/x1001000/py/blob/master/youbike.py