Last active
June 23, 2018 12:48
-
-
Save stephaniemdavis/f08e0759c5947a736a00d1228d30af06 to your computer and use it in GitHub Desktop.
A simple for loop. For loops only work on iterables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Written 6-23-2018 s.m.d Implementation of EdX Introduction to Computation & Programming Using Python | |
Convert the following code into code that uses a for loop. | |
prints 2 | |
prints 4 | |
prints 6 | |
prints 8 | |
prints 10 | |
prints "Goodbye!" | |
''' | |
# for loops only work on iterables!!!!! | |
def easy_for(): | |
for i in range(2,11,2): | |
print(i) | |
print('Goodbye!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment