[ create a new paste ] login | about

Link: http://codepad.org/pFzu84fo    [ raw code | output | fork ]

jonlyles - Python, pasted on Nov 9:
1
2
3
4
5
6
7
8
def count(sequence,item):
  count = 0
  for i in sequence:
    if i == item:
     count = count + 1
  return count

print count([5,5,5,5],5)


Output:
1
4


Create a new paste based on this one


Comments: