Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions