Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altendky/fea19dd17a2d43dc659a052f97c9172a to your computer and use it in GitHub Desktop.
Save altendky/fea19dd17a2d43dc659a052f97c9172a to your computer and use it in GitHub Desktop.
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