Skip to content

Instantly share code, notes, and snippets.

@rbricheno
Created September 23, 2019 09:31
Show Gist options
  • Save rbricheno/412273a5738e612c93f4bdf9a08bea60 to your computer and use it in GitHub Desktop.
Save rbricheno/412273a5738e612c93f4bdf9a08bea60 to your computer and use it in GitHub Desktop.
# Lets look at the "1 times table"...
table = 1
# ... up to 23
x = 23
print("Try 1 (wrong)")
for number2 in range(2,x+1):
for i in range(2,int(number2 ** 0.5)):
if (number2 % i) == 0:
break
else:
print(number2)
print("\nTry 2")
for number2 in range(2,x+1):
for i in range(2,number2):
if (number2 % i) == 0:
break
else:
print(number2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment