Question: Problem 2 : Write a python program that will get a collection of n numbers from the user. If the user entered 0 or a

Problem 2: Write a python program that will get a collection of n numbers from the user. If the user entered 0 or a negative number, the program terminates the process of entering numbers. The program uses the search () that is used to search a specified value by the user through the keyboard. If the value exists on the list of n numbers, the function returns how many times/ occurrences of that number from the given list. Otherwise, the program returns an appropriate message: "NO SUCH NUMBER!" and display it on the screen.
Sample Output:
Enter a number: 3
Enter a number: 2
Enter a number: 3
Enter a number: 2
Enter a number: 2
Enter a number: 3
Enter a number: 0
Enter the number to search: 4
NO SUCH NUMBER!
Do you want to search more (yn)=>y
Enter a number: 3
Enter a number: 2
Enter a number: 3
Enter a number: 2
Enter a number: 2
Enter a number: 3
Enter a number: -1
Enter the number to search: 3
There are 3 copies of "3" on my list.
Do you want to search more (yn)=>n
Press any key to continue
 Problem 2: Write a python program that will get a collection

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!