Last active
July 7, 2019 23:31
-
-
Save TooDumbForAName/f795c0dd26755e8387db173f92f69919 to your computer and use it in GitHub Desktop.
Increment Integer Evenly 'N' Times Starting At Zero
This file contains 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
#!/usr/bin/env python | |
import sys | |
N = int(input("Enter an integer: ")) | |
if N == 0: | |
sys.exit() | |
if N < 0: | |
print("Number must be positive!") | |
sys.exit() | |
eveninteger = 0 | |
loop = 0 | |
while loop < N: | |
print(eveninteger) | |
eveninteger = eveninteger + 2 | |
loop = loop + 1 | |
sys.exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment