Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the user inputs, complete a program that does the following tasks: Define a list, my _ list, containing the user inputs: my _ flower
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
daisy
aster
the output is:
rose 'peony', 'lily', 'rose', 'daisy'
rose 'peony', 'lily', 'rose', 'daisy', 'aster'
rose 'aster', 'lily', 'rose', 'daisy', 'aster'
rose 'lily', 'rose', 'daisy', 'aster'
rose 'rose', 'daisy', 'aster'
qxzqy
LAB ACTIVITY
: LAB: List basics
main.py
Load default template...
Develop mode
Submit mode
Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box.
Enter program input optional
If your code requires input values, provide them here.
Run program
Input from above
main.py
Your program
Output shown below
Program output displayed here
Coding trail of your work
What is this?
History of your effort will appear here once you begin working on this zyLab.
Feedback?
Activity summary for assignment: Unit Lab Assignment
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started