Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

Students also viewed these Databases questions

Question

Describe the visual representations, or models, of communication

Answered: 1 week ago