Question: python Write a function which takes a list of numbers, called numbers, as a parameter. The input list can be of any length. The function
Write a function which takes a list of numbers, called numbers, as a parameter. The input list can be of any length. The function should return the arithmetic mean (i.e. average) of the list, using the sum() and len() functions. What would happen if the input list contains nonnumerical items? You must test the following inputs: 2. Write a function which takes a list as a parameter. The function should use a while loop to iterate through the list items, and print the index of the item then the value of the item. Each item in the list must be printed, without anything being skipped. You must test the following inputs: 3. Using your solution for Exercise 2, create a new function which only prints the output if the input list contains the item 'red', and which also adds the item 'burgundy' to the end of the list before printing. Test your program with the same inputs as for Exercise 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
