13,420
edits
Changes
→PART 3 - Iterating Over Lists
for value in list_of_numbers:
print(square(value))
</source>You should see from the previous demonstration the advantage of using lists with functions. Although useful, the demonstration above only prints the squares as opposed to saving them for future use. The next demonstration uses a function that loops through lists, squares the values, but saves the squares in a new list.<br><br>