Fill This Form To Receive Instant Help
Homework answers / question archive / Variant 4: Make a function called count_number ( ) that finds how many times a number repeats within a list of integers
Variant 4: Make a function called count_number ( ) that finds how many times a number repeats within a list of integers. Your function must take two parameters, the number to search for and the list to look through. Your function should return the number of occurrences of the chosen number. Example: Output Example: > > > mylist = [9.0.8,8,0, 4,4,9,5,2,0,8,1,0,3.3,0,8,1,3] > > > print (count_number (9, mylist) ) Number 9 appears 2 times in [9. 0.8, 8, 0, 4, 4.9.5,2,0,8,1,0,3,3, 0,8,1,3] > > > result = count_number (2, mylist) > > > print (result) Number 2 appears 1 time in [9, 0,8,8, 0, 4, 4,9,5,2, 0,8, 1,0,3,3, 0,8,1,3 ]