Question: In Python Write a program which performs the following tasks: (1) create a list named num1 and initialize it with the following values: 'yes', 20,

In Python

Write a program which performs the following tasks:

(1) create a list named num1 and initialize it with the following values:

'yes', 20, 30, 40, 50, 'no'

(2) modify the first element to 10 using the corresponding positive index, and modify the last element to 60 using the corresponding negative index. Print the modified list num1.

(3) create another list named num2 which has three elements 70, 80, 90. Then, concatenate num2 to the back of num1, so that num1 is extended. Print the extended list num1.

In Python Write a program which performs the following tasks: (1) create

The original list is ['yes', 20,30,40,50, 'no'] The modified list is [10,20,30,40,50,60] The extended list is [10,20,30,40,50,60,70,80,90]

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!