Question: 3 . 2 0 LAB: List basics Instructor note: Reminders: to create a list: the _ list = ' [ one , two, three ]
LAB: List basics
Instructor note:
Reminders:
to create a list: thelist one two, three
to combine concatenate lists: onelist twolist
to add thing to a list: thelist.append thing
to find the position index of thing in a list: thelist.index thing
to assign something to an index of a sequence string or list: thelist index thing
to remove an element from a list: thelist.remove thing
to remove an element from a list and assign it to a variable: result thelist.pop index
Given the user inputs, complete a program that does the following tasks:
Define a list, mylist, containing the user inputs: myflower myflower and myflower in the same order.
Define a list, yourlist, containing the user inputs, yourflower and yourflower in the same order.
Define a list, ourlist, by concatenating mylist and yourlist.
Append the user input, theirflower, to the end of ourlist.
Replace myflower in ourlist with theirflower.
Remove the first occurrence of theirflower from ourlist without using index
Remove the second 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
