-2

For example, i have a list the outputs should look like

3

4

bob= [ 1,2,2,3,3,3,1,2,3,4,5,6]

print(random_method(bob, 2))
print(random_method(bob, 3))

1 Answers1

0
bob= [ 1,2,2,3,3,3,1,2,3,4,5,6]
def random_method(b,i):
  return b.count(i)
print(random_method(bob, 2))
print(random_method(bob, 3))
Jay Shankar Gupta
  • 5,918
  • 1
  • 10
  • 27