๐ญ Study/: Python
๐ปPython:: ์๋ฃํ List & Tuple & Dictonary
๐List ๐๋ฆฌ์คํธ์ ์์ฑ๊ณผ ์ฌ์ฉ a=[] b=[1,2,3] c=['I','hate','studying'] d=[['what','the'],1,'too'] ์ซ์, ๋น์ด์๋ ๋ฆฌ์คํธ, list ์์ฒด, ๋ฌธ์์ด ๋ฑ ์ด๋ค ์๋ฃํ๋ ํฌํจ ๊ฐ๋ฅ ๐๋ฆฌ์คํธ ์ธ๋ฑ์ฑ& ์ฌ๋ผ์ด์ฑ ๋ฆฌ์คํธ ์ธ๋ฑ์ฑ a=[1,2,3] a[0]+a[2]->์ถ๋ ฅํ๋ฉด 4 list of list์์ ์ธ๋ฑ์ฑ >>> a=[1,2,'Stop',['A','B','C']] >>> a[-1][0] >>> 'a' ๋ฆฌ์คํธ ์ฌ๋ผ์ด์ฑ >>> a=[1,2,3,4,5] >>> a[0:2] [1,2] ๋ฆฌ์คํธ ์ฐ์ฐ ๋ํ๊ธฐ(+) ๋ฆฌ์คํธ๋ฅผ ํฉ์น๋ ๊ธฐ๋ฅ ๋ฐ๋ณตํ๊ธฐ(*) ๋ฆฌ์คํธ ๋ฐ๋ณต์ ๊ธฐ๋ฅ ๋ฆฌ์คํธ ์์ ๋ฐ ์ญ์ a=[1,2,3] a[2]=4 ->a=[1,2,4] ์ญ์ -> del() ์ด์ฉ ..
2024. 1. 25.