Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1. (2 points) Fill the parts of the code below. In [ ]: # Let's create an empty List my_list = # Let's add some
Q1. (2 points) Fill the parts of the code below. In [ ]: # Let's create an empty List my_list = # Let's add some values my_list. ____('Python') my_list. ('is ok') my_list. ('sometimes) # Let's remove 'sometimes' my_list. (sometimes) # Let's change the second item my_list[_] = 'is neat' Q2. (2 points) Consider the following list. Write a program to find total and mean of the list. In [ ]: list1 = [ i for i in range (1000) if i%3 ==] In [ ]: # write your program here: Q3: (2 points) Consider the following list. Write a program that stores the reverse of Numberlist in a new list called NumberlistRevised Hint. Start with the empty list NumberlistRevised and fill it using the pop() function on Numberlist multiple times. In [ ]: Numberlist = [i for i in range(11)] In [ ]: # write your program here: Q4: (4 points) Consider the following list In [11]: Listofnums = [[@],[1,2,3],[4,5,6,7],[8,9,10]] In [4]: #4.1: Using list indices print the first, then the second and then the third child list. In [5] : # 4.2: Using list indices, print out elements 0,3,4,9 In [7]: # 4.3. Replace the object 8 with 88. In [8]: # 4.4. Append the new child List (11,12,13,14] to the end of the nested List. In [9]: # 4.5. Using del function, remove the second child list in the nested List In [10]: #4.6. Using the remove() function, remoce the elements 4 and 9 rom the nested List In [ ]: #4.7. Usingh the in function, check whether the number 10 is in any of the child List In [ ]: # 4.8. Using the Len() function, determin how many child list are containted in the parent list
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