# 2024/07/31 Python 職訓所課程筆記
> [TOC]
<!-- notion link :
https://absorbing-bookcase-ffc.notion.site/2024-07-31-79b30c36611940e9bec9ab1f23d957fa
雲端連結:
https://drive.google.com/drive/folders/12Yi_Oj9rHgX1YuVEgOYUC141hDZRFHR3?usp=share_link
meet link :
https://meet.google.com/kta-snny-ocd
透過知識資料庫整理所學 -->
## PYTHON INSTALL
VERSION CHECK
Python 3.10.11
環境變量設定
Use the Notion platform to provide class content handouts
ide : vscode or pycharm (課堂使用)
anaconda 肥肥的,裝了一大堆,很難移除。
https://stackoverflow.com/questions/42182706/how-to-uninstall-anaconda-completely-from-macos
Python IDE 安裝教學
## Python 六大類型別
老師說其實是 6+3
6+3( bool 布林 / None 空值 / bytes)
### 1. `string` 字串
- 文字資料,常用於處理字母、單字、句子等。
- 使用雙引號或單引號定義,例如:`"Hello"` 或 `'World'`。
### 2. `num` 數字
- 包含整數 (`int`) 和浮點數 (`float`)。
- 用於數學運算,例如:`123`(整數),`3.14`(浮點數)。
### 3. `list` 串列
- 有序的可變資料集合,允許重複的元素。
- 用中括號表示,元素之間以逗號分隔,例如:`[1, 2, 3, "apple"]`。
### 4. `tuple` 元組
- 有序的不可變資料集合,允許重複的元素。
- 用小括號表示,例如:`(1, 2, 3, "apple")`。
### 5. `dict` 字典
- 無序的鍵值對集合,用於儲存資料之間的映射關係。
- 用大括號表示,鍵和值之間用冒號分隔,例如:`{"name": "John", "age": 30}`。
### 6. `set` 集合
- 無序且不允許重複元素的集合。
- 用大括號表示,例如:`{1, 2, 3, "apple"}`。
## Turtle module
:::info
OOP 物件程式導向語言
what is that ? 課後作業查詢
類別建構式 :arrow_right: 產生物件
https://pythonbook.cc/chapters/basic/oop
只看了上方文章繼承前面的說明,繼承那邊開始看不懂,未來再深究。
:::
## 基本指令
help()
print()
type()
<class 'str'>
透過"類別" class 產生"物件" object
tutrtle module intro
class generate object
OOP
字串物件的方法
dir(str)
:::success
自學必備技巧!
:::
```python!
['capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'removeprefix', 'removesuffix', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
```
有用過的: `count` `find` `replace` `split` `join`
## Pycharm 基本設定
https://medium.com/@iloveitone/pycharm%E5%9F%BA%E6%9C%AC%E8%A8%AD%E5%AE%9A-f988f243d9cf
https://ithelp.ithome.com.tw/articles/10192774?sc=iThelpR
## Python turtle 烏龜繪圖
https://docs.python.org/3/library/turtle.html
https://www.geeksforgeeks.org/turtle-programming-python/
https://replit.com/@wastu01/tutrtle
install package
pychram 同步 github
https://suipichen.medium.com/pycharm-%E5%92%8C-github-%E9%80%A3%E5%8B%95%E8%A8%AD%E5%AE%9A-785b3b3adf4e
## 其他模組
Python 內建函式官方手冊
https://docs.python.org/3.10/library/functions.html
ITERTOOLS
https://steam.oxxostudio.tw/category/python/library/itertools.html
MATH
https://steam.oxxostudio.tw/category/python/library/math.html
OS
https://steam.oxxostudio.tw/category/python/library/os.html
DATETIME
https://hackmd.io/@DCT/python-datetime-time
RANDOM
https://steam.oxxostudio.tw/category/python/library/random.html
TLDR : 有用到再瞭解,知道怎麼查比較重要,dir(),type()。