Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the user inputs, complete a program that does the following tasks: Define a list, myList, containing the user inputs myFlower 1 , myFlower 2

Given the user inputs, complete a program that does the following tasks:
Define a list, myList, containing the user inputs myFlower1, myFlower2, and myFlower3 in the same order.
Define a list, yourList, containing the user inputs yourflower1 and yourFlower2 in the same order.
Define a list, ourList, by concatenating myList and yourList.
Append the user input theirflower to the end of ourlist.
Replace myFlower2 in ourlist with theirFlower.
Remove the third element of ourList.
Observe the output of each print statement carefully to understand what was done by each task of the program.
Ex: If the input is:
rose
peony
lily
rose
daisy
aster
the output is:
['rose', 'peony', 'lily']
['rose', 'daisy']
['rose', 'peony', 'lily', 'rose', 'daisy']
['rose', 'peony', 'lily', 'rose', 'daisy', 'aster']
['rose', 'aster', 'lily', 'rose', 'daisy', 'aster']
['rose', 'aster', 'rose', 'daisy', 'aster']
image text in transcribed

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions