๋‚ด์žฅํ•จ์ˆ˜

1.ComprehensionList , Dictionary๋“ฑ์„ ๋น ๋ฅด๊ฒŒ ๋งŒ๋“œ๋Š” ๊ธฐ๋ฒ•์œผ๋กœ for + append๋ณด๋‹ค ์†๋„๊ฐ€ ๋น ๋ฅด๋‹ค. if ๋ฌธ์„ ๋„ฃ์–ด ์›ํ•˜๋Š” ์š”์†Œ๋งŒ ์ถ”๊ฐ€ ๊ฐ€๋Šฅ ๊ฒน for ๋ฌธ ์‚ฌ์šฉ ๊ฐ€๋Šฅ ๋‹ค์ฐจ์› ๋ฐฐ์—ด์„ ๋งŒ๋“ค๊ธฐ์— ๋งค์šฐ ์œ ์šฉ (๋‹จ, ์ตœ์ ํ™” ํ•  ๋•Œ ์‚ฌ์šฉ → ๋ณต์žกํ•ด์ง€๋ฉด ๊ฐ€๋…์„ฑ์ด ๋–จ์–ด์ง€๊ธฐ ๋•Œ๋ฌธ) evens = [ i for i in range(100) if i % 2 == 0 ] #if ์กฐ๊ฑด์ด ๋“ค์–ด๊ฐ„ comprehensionresult = [(i,j) for i in range(5) for j in range(i)] #๊ฒน for๋ฌธ2.Generatorrange ํ•จ์ˆ˜์˜ ๊ฒฝ์šฐ ์ˆซ์ž๋ฅผ ํ•˜๋‚˜์”ฉ ์ƒ์„ฑํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•œ๋‹ค. ์ด์™€ ๊ฐ™์ด ์š”์†Œ๋ฅผ ํ•˜๋‚˜์”ฉ ์ƒ์„ฑํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ฐ์ฒด๋ฅผ Generator๋ผ๊ณ  ํ•œ๋‹ค. function์—์„œ yi..
zzoming_00
'๋‚ด์žฅํ•จ์ˆ˜' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก