0
0

More than 1 year has passed since last update.

paizaラーニング「何個ある? 2 Python3編」

Last updated at Posted at 2022-12-13

私の解答

n =  int(input())
li = [1, 2, 5, 1, 4, 3, 2, 5, 1, 4]
print(li.count(n))

解答例1

N = int(input())
li = [1, 2, 5, 1, 4, 3, 2, 5, 1, 4]

ans = 0
for ele in li:
    if ele == N:
        ans += 1

print(ans)

解答例2

N = int(input())
li = [1, 2, 5, 1, 4, 3, 2, 5, 1, 4]

print(li.count(N))
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0