---
# System prepended metadata

title: 1. 群集-List說明與實作
tags: [' 筆記', Python 進階語法與應用]

---

---
title: 1. 群集-List說明與實作
tags: Python 進階語法與應用, 筆記
---

# 1. 群集-List說明與實作

群集：一群的號碼 但是裡面不重複 
1. list 排隊清單 [0,1,2,3] 中括號 
- 有順序性
- 不同類型？No [3,"hello"]語法ok但不要做 要同類型


### for.(暫時名字）..in [群集]:


---
name_list = ["Elwing", "Amy", "Bob"]
print(name_list)

print(name_list[0])
print(name_list[0:2])

name_list = name_list + ["Carol"]
print(name_list)

print(len(name_list))

for n in name_list:
    print("-", n)

---	
	
→['Elwing', 'Amy', 'Bob']
Elwing
['Elwing', 'Amy']
['Elwing', 'Amy', 'Bob', 'Carol']
4
-Elwing
-Amy
-Bob
-Carol

# END

