1,234
edits
Changes
→PART 3 - Iterating Over Lists
: You will now learn how to define and run functions that will return '''string data''' when a function is called.
:'''Perform the Following Steps:'''
::The following '''for''' loop will store the value of each element from list_of_numbers within a variable named '''item''' and run code indented below the loop for each item.<br><br>
:#Issue the following in the ipython shellRun this from a temporary Python file:<source lang="python">
list_of_numbers = [ 1, 5, 2, 6, 8, 5, 10, 2 ]
for item in list_of_numbers: