Question: 2: x=[1, 3, 5, 6, 7, 8, 6, 1, 2, 3] y=[0, 0, 0, 0, 0, 0, 0, 0] Write python code using while loop

 2: x=[1, 3, 5, 6, 7, 8, 6, 1, 2, 3]

2: x=[1, 3, 5, 6, 7, 8, 6, 1, 2, 3] y=[0, 0, 0, 0, 0, 0, 0, 0] Write python code using while loop that write average of first three items on first index of y and so on. The print(y) should give the following output o [3.0, 4.666666666666667, 6.0, 7.0, 7.0, 5.0, 3.0, 2.0] Define a function that takes list as argument and returns the average of it. Then calculate the average of x and y. Home Tasks: Write a code that takes two integers from user as input and store in x and y variables. Now generate a list (w) of x elements and each element contains y random integers ranging from 1 to 10 and display this list. . Now ask user to enter a number from 1 to 10 and display the number of times that integer occurs in the whole list (w). Write a code that calculate mean, median and mode of the list (w). Write a code that make another list (u) of same dimensions and compare each number of original list (w) with the average of it calculated in the previous part, if the number is less than the average, the code should place 0 on the corresponding index in newly created list (u) else it should place 10. Display the list (u)

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!