Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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] 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started