Created
September 27, 2017 16:13
-
-
Save paravar/dcdb497e759a1fb19583021bfc74f8fa 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