Basic Lists 1¶
Create an empty list. You must use a loop to append the value -113
into the list ten times.
Additionally, create a second loop below the first that will iterate through the list and print out each element. Do not use a literal number in the range()
function, you must use the len()
function to inform the range
function how many index numbers to generate.
Name your file list1.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