Lab Deliverables
Please upload your code Lab2.py to Gradescope. Also, please upload a file called comments.txt that
answers the following questions:
1. Why was using a while loop in this instance what you should do?
2. What does appending to lists mean?
3. How could you use what you learned in today's lab to store information?
4. If you worked in a group, please note the contributions that you made to the code. If you did
not, please write "I worked by myself."
Lab
Create a program Lab2.py that will continuously add words to a list until the user enters the keyword
"done." After that, please print the list that you have created.
HINTS:
- To declare an empty list, use ls = []
- To add x to a list ls, use ls.append(x)
- You should be using a while loop to check if the user has entered "done"
- To get input from the command line, use x = input("Please enter a word: ")
C:/Users/pamel/PycharmProjects/Lab2/Lab2.py
Please enter a word (enter 'done' when finished): The
Please enter a word (enter 'done' when finished): lion
Please enter a word (enter 'done' when finished): sleeps
Please enter a word (enter 'done' when finished): tonight
Please enter a word (enter 'done' when finished): done
['The', 'lion', 'sleeps', 'tonight']