nick34992
1/12/2017 - 2:19 AM

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

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

#!/usr/bin/python3

for count in range(11):                # range iteration
    if count != 0 and count % 2 == 0:  # conditional statement
        print('count =', count)        # even values, n % 2 == 0
print('Goodbye!')

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

count = 2
count = 4
count = 6
count = 8
count = 10
Goodbye!
'''