Question: Using Python, create a program that find average of odds and evens numbers. a . The program should ask the user for numbers and continue

Using Python, create a program that find average of odds and evens numbers.
a. The program should ask the user for numbers and continue to take numbers from user until the
user press -1. Hint: use infinite loop and break from it when user enters -1.
b. Create the following functions:
i) CheckEvenOdd(mylist)
This function takes the entire list as input (parameters) and return two lists.
First, declare two empty list, for holding even/odd numbers.
You should iterate through the list and check each number for even/odd.
If the number is odd append to the Odd list, otherwise append to Even list.
Return the Odd and Even list
ii) CalculateAverage(mylist)
This function takes the entire list as input (parameters) and return two values.
Inside this function, you should call CheckEvenOdd(mylist) and store the return values into variables.
Then calculate the average. Do not use sum() function. You should iterate through the list using for loop to find the sum. You can use len() function
iii) PrintResults(avgeven, avgodd)
This function takes the average as input and print it.|
iv) CalculatePow(mylist)
This function should calculate the numbers in the list to the power of their index and return the result in the list. No need to check for even/odd.
If number in index 2 is 4, it should calculate 4???2.
You can use pow() function.
c. Inside the main body of your code, take the numbers from the user and print the average of both even/odd numbers and the power calculation.
d. Looping indefinitely (Hint: use infinite while loop), the program should give the user the option to repeat the operation. You should have two loops in your program.
Note: Do not write the functions declaration inside the loop.
e. You should use the same functions and variables names. You should pass the same arguments to the functions.
 Using Python, create a program that find average of odds and

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!