PYTHON-教學
7 articles tagged with "python-教學"
- Python 教學 9 - Python Mapping Type: dict2023-09-04
dict 是 Python 中的 ,類似 js 中的 object,每一個 element 都由 key 和 value 組成。
- Python 教學 8 - Python Set Type: Set, Frozenset2023-09-03
Python set 和 frozenset 常用來表示一群不重複 element 的集合,這篇文章就來介紹一下 Python set 和 frozenset。
- Python 教學 7 - Python Sequence Type: List, Tuple 介紹2023-09-03
Python 有兩個較常用的 sequence type:list 和 tuple,有些文章雖然也會把 string 列為 sequence type,不過嚴格來說,string 算是另一種類別的 sequence - ,再加上有在另外一篇文章介紹過 string 了,所以這邊就不再提了。
- Python Generator 介紹2023-08-30
Python generator object 其實是 iterator 的一種,所以一樣有 iterator 的特性: - 只能 iterate 一次 - 可以用 next function 取得 iteration 的下一個 item 1. 宣告 Python Generator
- Python Iterator 介紹2023-08-29
Python Iterator 常常會和 Iterable object 一起搞混,這篇就來介紹一下 Python 中的 Iterator。
- Python Comprehension 語法 - List Comprehension, Set Comprehension, Dict Comprehension2023-08-27
Comprehension 算是 Python 特有的語法,可以用來宣告一些特定 object,或是對這些 object 做一些操作。 1. List Comprehension List comprehension 用來宣告 list object,或是對已存在的 list object 做一些 value 的 update。
- Python 教學 1 - 環境架設 ( pyenv ) 與 Python 簡介2023-08-14
雖然可以直接在 Python 官網安裝特定版本,但通常 local 上如果有不只一個 Python 專案的話,使用 pyenv 會比較好管理不同專案的 Python 版本。