Question: Use Python3 I already done the first part. I just dont know how to do second part. Vrite a Python function that performs the following:

Use Python3
I already done the first part. I just dont know how to do second part.
Use Python3I already done the first part. I just dont know how
to do second part. Vrite a Python function that performs the following:

Vrite a Python function that performs the following: Takes a single list of integers as an input. (An input "parameter" is required by AP) 2) Iterates through the list to compute the average of all the numbers in the list (Iteration is required by AP) 3) Returns True if the average is positive. Returns False if the average is negative (Selection is required by AP) Then, call the function in a broader program/function that does the following: 1) Sets a variable "num" to 0 2) Starts a "while" loop that will keep going until "num" == " N " or " n " 3) Keeps asking the user for a number and adds it each time to the list (AP requires user input) 4) Prompts the user to stop adding numbers by entering " N " or " n " instead of a number when done. Use num = input("Enter a number, or ' N ' when done") 5) Calls the first function above on the resulting list and tells the user whether his list had a positive or negative average in a sentence. (AP requires output)

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!