Last active
July 5, 2021 21:11
-
-
Save PythonDotLand/5e17ee7763a890197c99128cf4fb90d4 to your computer and use it in GitHub Desktop.
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
| for n in range(2, 10): | |
| for x in range(2, n): | |
| if n % x == 0: | |
| print(n, 'equals', x, '*', n//x) | |
| break | |
| else: | |
| # loop fell through without finding a factor | |
| print(n, 'is a prime number') |
Thanks.. something went wrong with the copy/pasting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just read your blogpost. Thanks for sharing.
I think you'll need to update this gist to indent your
elseclause andifstatement.like this:
Thanks for sharing, this was new to me. :)