Basic Lists 0¶
Create an empty list. Append to the array the number -113
ten times using the list.append()
method. Then display the contents of the list on the screen. One element at a time.
Do not use a loop. Also, do not use any variable for the index; you must use literal numbers to refer to each slot.
Name the file list0.py
Slot 0 contains a -113
Slot 1 contains a -113
Slot 2 contains a -113
Slot 3 contains a -113
Slot 4 contains a -113
Slot 5 contains a -113
Slot 6 contains a -113
Slot 7 contains a -113
Slot 8 contains a -113
Slot 9 contains a -113
©2021 Daniel Gallo
This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Adapted for Python from Graham Mitchell’s Programming By Doing