Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

1 byte added, 17:28, 3 June 2017
PART 3 - Iterating Over Lists
:'''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>
:#Issue the following in the ipython shell:<source>
list_of_numbers = [ 1, 5, 2, 6, 8, 5, 10, 2 ]
13,420
edits