Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2:115 marks) a- Write a Python function num_List that prompts the user to enter positive integers. The function should keep on entering the integers

image text in transcribed
Question 2:115 marks) a- Write a Python function num_List that prompts the user to enter positive integers. The function should keep on entering the integers and adding them to a list until a negative number is entered. Make sure that this list can be used in other parts of a program. (7 marks) b- Suppose that we want to call the above function and place only the numbers that are multiple of either 3 or 7 in a new list, and then display this list. Write down the statements that implement the task. (4 marks) c- You should include your code (Typed) with a screenshot of the output. (4 marks) Expected Output: Enter a positive integer, any negative integer to stop 0 Enter a positive integer, any negative integer to stop 5 Enter a positive integer, any negative integer to stop 7 Enter a positive integer, any negative integer to stop 21 Enter a positive integer, any negative integer to stop 42 Enter a positive integer, any negative integer to stop 55 Enter a positive integer, any negative integer to stop 84 Enter a positive integer, any negative integer to stop 1 [0, 21, 42, 84]

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

Linear Algebra and Its Applications

Authors: Gilbert Strang

4th edition

30105678, 30105676, 978-0030105678

More Books

Students also viewed these Mathematics questions