15 lines
257 B
Python
15 lines
257 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
def count_in_array(x, A):
|
||
|
c = 0
|
||
|
for elem in A:
|
||
|
if elem == x:
|
||
|
c = c + 1
|
||
|
return c
|
||
|
|
||
|
def main():
|
||
|
print(count_in_array(5, [7, 5, 16, 3, 10, 5, 8, 1, 29, 13, 28]))
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|