Forked from paravar/gist:dcdb497e759a1fb19583021bfc74f8fa
Last active
September 27, 2017 16:32
-
-
Save altendky/fea19dd17a2d43dc659a052f97c9172a 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
def is_isogram(string): | |
string_lower = string.lower() | |
for i in string_lower: | |
if not i.isalpha(): | |
continue | |
for n in range(string_lower.index(i) - 1, | |
string_lower.index(i) - len(string_lower), -1): | |
if string_lower[n] == i: | |
print("\"%s\" is not an isogram.") % (string) | |
return False | |
print("\"%s\" is an isogram!") % (string) | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment