Friday, October 10, 2014

Day 135

Python at CodeCademy. Worked on Python tutorial 3 of 13, A Day at the Supermarket: Control Flow and Looping! Worked on performing different actions depending on the particular item in the list, while looping.

Code used:
a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

for number in a:
    if number % 2 == 0:
        print number


Interaction for this code:
0
2
4
6
8
10
12

No comments:

Post a Comment