nick34992
1/12/2017 - 2:41 AM

MITx 600.1x | Week 1 | Python Basics | 2. Core Elements of Programs | Exercise for: Item 2

MITx 600.1x | Week 1 | Python Basics | 2. Core Elements of Programs | Exercise for: Item 2

#!/usr/bin/python3

print("Hello!")
for num in range(10, 0, -2):  # loop statement
    print('num =', num)

'''
MITx 600.1x | Week 1 | Python Basics | 2. Core Elements of Programs | Exercise for: Item 2

Hello!
num = 10
num = 8
num = 6
num = 4
num = 2

range(10, 0, -2) means:
1. 10 items in range.
2. 0 is start of range (0-10).
3. step through range by -2 (backwards).
'''