Changes

Jump to: navigation, search

OPS435 Python Lab 3

1 byte added, 18:30, 3 June 2017
PART 3 - Iterating Over Lists
:This last section demonstrates an extremely useful for lists: the ability to quickly '''loop through every value in the list'''. '''For loops''' have a set number of times they loop. The '''for''' loop (a "determinant" loop) will execute all indented code for each item (element) in the list. Using loops with list allow for efficient processing of stored data.
::'''Perform the Following Steps'''
::Let's take a moment to understand how the '''for''' loop works. The for loop will store data within a temporary variable (in the demonstration below, the variable called: '''item''') and run code that are indented below the for loop. This operation will repeat until ALL contained items within the list have been used.<br><br>
13,420
edits

Navigation menu