Question: 7 1 # Problem 3 def count _ num ( nums , find _ num ) : 1 1 1 Return the number of times

71
# Problem 3
def count_num(nums, find_num):
111
Return the number of times the number find_num occurs in the given list
Arguments:
nums: a list of ints
find_num: the integer to count the occurrences of in nums
Returns:
A integer representing the number of times find_num appears in nums
# your solution code should start here
assert count_num ([1,5,6,2,1],1)==2
assert count_num ([],4)==0
assert count_num ([1,2,3],1)==1
assert count_num ([4,5,6],2)==0
assert count_num ([160],160)==1
assert count_num ([90],25)==0
assert count_num ([5,5,5],5)==3
assert count_num ([3,6,12,9,12],12)==2
 71 # Problem 3 def count_num(nums, find_num): 111 Return the number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!