# Python 讀書會 第一彈 ###### tags: `python` ## Pycharm 介紹 快捷鍵(hotkey): 絕對路徑: 類似住址: 鳳山某街幾號 相對路徑: 以某地區為路徑的起始點來描述 例如: 電子街口的對面 避免版本不同造成問題 使用Preference可以調整版本 [Python快捷鍵](https://yangfangs.github.io/wiki/pycharm-Shortcut-key/) [Ctrl+Shift+A Actions](https://www.jetbrains.com/pycharm/guide/tips/find-action/) 重新排版 [Ctrl+Alt+L] ## 甚麼是Function? Funtion案例 ``` def print_20(): for i in range(20): print(i) ``` 但這真的太累了,所以可以修正原有的Function 就可以進行重構 重構的案例 ``` def print_num(num): for i in range(num): print(i) print_num(50) print_num(60) ``` ## Class跟Function Class 物件都用大寫命名 Function 都會用小寫來命名 ![](https://i.imgur.com/3pszEi8.png) ## 九九乘法表 ![](https://i.imgur.com/t9KjUcf.png) ##金字塔 ![](https://i.imgur.com/iuhb6QR.png) ![](https://i.imgur.com/hCibEg1.png) Assignment: - [ ] 1. 物件 - [ ] 2. function - [ ] 3. SOLID原則 - [ ] 4. 好玩的小專案~