MapleStory Finger Point

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

#10807 ๊ฐœ์ˆ˜ ์„ธ๊ธฐ - python

HYEJU01 2024. 4. 13. 01:27
N = int(input())
a = []
a = list(map(int,input().split()))
v = int(input())
print(a.count(v))

 

list ๊ฐ’์„ ๊ณต๋ฐฑ๊ฐ’์ฃผ๊ณ  ๋ฐ›์•„์˜ค๊ธฐ

ํŒŒ์ด์ฌ์€ ๊ตณ์ด N์„ ๋ฐ›์•„์™€๋„ ์“ธ ํ•„์š”๊ฐ€ ์—†์–ด๋ณด์ธ๋‹ค (?)

 

 

- list() ํ•จ์ˆ˜

list ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด list ์•ˆ์— ์ž…๋ ฅํ•œ ๊ฐ’์ด ์ฐจ๋ก€๋Œ€๋กœ ๋“ค์–ด๊ฐ„๋‹ค.

 

- count() ํ•จ์ˆ˜ 

๋ฆฌ์ŠคํŠธ.count(์ฐพ์„๋‹จ์–ด) ์ž…๋ ฅ

์ฐพ๋Š” ๋‹จ์–ด์˜ ๊ฐœ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ด์ค€๋‹ค.