MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Python

#3052 ๋‚˜๋จธ์ง€ -python

HYEJU01 2024. 4. 15. 03:30
a=[]

for i in range(10):
    n = (int(input())%42)
    if n not in a:
        a.append(n) 
print(len(a))

 

 

 

<< ๐Ÿคฎ ๋ง‰ํžŒ ์ด์œ  & ํ•ด๊ฒฐ  >>

a=[]

for i in range(10):
    a.append(int(input())%42))

์‹œ์ž‘์„ ๋ฐ”๋กœ ๋‚˜๋จธ์ง€ ๊ฐ’์„ ๊ณ„์‚ฐํ•ด์„œ ๋„ฃ์–ด๋ฒ„๋ฆฐ๋•์—

๋ฆฌ์ŠคํŠธ์— ๋‹ด๊ธด ๊ฐ’์ด ๊ฐ™์€ ๊ฐ’์ด ์•„๋‹Œ ๊ฑธ ์ฐพ์•„๋‚ด๋ ค๋ฉด

๊ฐ’ ํ•˜๋‚˜์— ํ•œ๋ฐ”ํ€ด์”ฉ ๋Œ๋ฉฐ ๋น„๊ตํ•ด์•ผ๋˜๋Š”๋ฐ....???

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ฝ”๋“œ๋ฅผ ๋‹ค ์ ์–ด์•ผํ•˜๋Š”๊ฑด๊ฐ€ ์‹ถ์œผ๋ฉด์„œ ๐Ÿ˜จ

๋ณต์žกํ•œ ์ƒ๊ฐ์„ ํ–ˆ๋Š”๋ฐ....

 

๋ฆฌ์ŠคํŠธ์— ๋„ฃ๊ธฐ ์ „์— ๋จผ์ € ๋‚˜๋จธ์ง€ ๊ฐ’์„ ๋ณ€์ˆ˜์— ๋„ฃ๊ณ 

ํ•ด๋‹น ๋ณ€์ˆ˜๊ฐ’์ด 

๋ฆฌ์ŠคํŠธ์— ์žˆ๋Š”์ง€ ์—†๋Š”์ง€ ํ™•์ธํ•œ ๋’ค ,

์ถœ๋ ฅํ•˜๋ฉด ํŽธํ–ˆ๋˜ ๊ฒƒ... ๐Ÿ˜Š

 

 

 

<< ๐Ÿ”” ์‚ฌ์šฉ๋œ ํ•จ์ˆ˜ >>

๐Ÿ”” ๋ฆฌ์ŠคํŠธ๋ช….append() : ๋ฆฌ์ŠคํŠธ์— ๊ฐ’ ์ถ”๊ฐ€ํ•˜๊ธฐ

๐Ÿ”” ๊ฐ’ in ๋ฆฌ์ŠคํŠธ / ๊ฐ’ not in ๋ฆฌ์ŠคํŠธ : ํŠน์ • ๊ฐ’์ด ๋ฆฌ์ŠคํŠธ์— ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ์—ฐ์‚ฐ์ž

๐Ÿ””   len (๋ฆฌ์ŠคํŠธ) : ๋ฆฌ์ŠคํŠธ์— ํฌํ•จ๋œ ์š”์†Œ์˜ ๊ฐœ์ˆ˜ ๋ฐ˜ํ™˜