count in list

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 19:05:57 +03:00
parent 6e182d0c2a
commit ac40da0d95
No known key found for this signature in database
GPG key ID: 2100A876D55B39B9

8
count.in.list.py Normal file
View 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)