Created
April 26, 2018 01:36
-
-
Save dawranliou/306e98b317446a5aa1197f1e86003f5e 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
def is_tri(n): | |
for tri in tri_gen(): | |
if tri > n: | |
return False | |
elif tri == n: | |
return True | |
else: | |
continue | |
is_tri(10) | |
# True | |
is_tri(11) | |
# False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment