To get experience with using lists in programs.
For this lab you will write a program which reads in a list of strings from
the user. You can use the empty string
"" as a terminal
value. So the user can enter as many strings as they want, then hit enter
without entering anything to indicate they are done. Make sure you don't put
"" into the list!
Your program will then print out the list of strings backwards. There are two main ways to do this:
Here is an example run:
Enter a string: These Enter a string: are Enter a string: some example Enter a string: words Enter a string: words some example are These
Notice that it reverses the lines. If you put multiple words in one string, like "some example", they aren't reversed themselves. That's OK here!
When your program is finished, email the .py file to firstname.lastname@example.org.
Copyright © 2019 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.