count in list
This commit is contained in:
parent
6e182d0c2a
commit
ac40da0d95
1 changed files with 8 additions and 0 deletions
8
count.in.list.py
Normal file
8
count.in.list.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
a = [1, 2, 2, 3, 4, 5, 2, 1, 2, 3, 1, 2]
|
||||
val = int(input('Aranacak değeri giriniz:'))
|
||||
|
||||
count = 0
|
||||
for i in a:
|
||||
if i == val:
|
||||
count += 1
|
||||
print(count)
|
Loading…
Reference in a new issue