Question: Solve all tasks using python Task 2 (40 points). Given a list, update the elements in the list based on the following condition: if the

Solve all tasks using python Task 2 (40 points). Given a list,Solve all tasks using python

Task 2 (40 points). Given a list, update the elements in the list based on the following condition: if the current index is an odd number, list1[index] will be 2*list1[index] otherwise, list1[index] will be listi[index]*list1[index]. e.g. if list1 = [1,2,3,4), the final result is (1,4,9,8] if list1 = [5,10,3,4], the final result is (25,20,9,8] Task 3 (40 points). Given a list, update the elements in the list based on the following condition: if the current element is an odd number, list1[index] will be 2*list1[index] otherwise, lista[index] will be list1[index]*listi[index]. e.g. if list1 = (1,3,4,6), the final result is [2,6,16,36] if list1 = [5,10,3,4], the final result is [10,100,6,16] Task 1 (20 points). Write the corresponding code to complish the subtasks Given a value n, apply the while loop to generate the result of the factorial which is 1*2*3*4* ... *(n-1)*n E.g. n=3, the result will be 6 n=6, the result will be 120 n=1, the result will be 1

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!