Created
November 7, 2016 14:02
-
-
Save timhberry/0bac5d8a6a80f1f6701af1bf7b62a910 to your computer and use it in GitHub Desktop.
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
# print all the prime numbers up to 'upto' | |
# quick project for UTAustinX UT.9.10x | |
# Effective Thinking Through Mathematics | |
# and Open Source Society University | |
num = 2 | |
upto = 1000 | |
while num < upto: | |
prime = True | |
for i in range(2, num): | |
if (num % i == 0): | |
prime = False | |
if (prime): | |
print num, | |
num = num + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment