Skip to content

Instantly share code, notes, and snippets.

@AdryDev92
Created May 17, 2025 14:11
Show Gist options
  • Select an option

  • Save AdryDev92/ba7137c8bae74cf4b2ac14c46ea74c5b to your computer and use it in GitHub Desktop.

Select an option

Save AdryDev92/ba7137c8bae74cf4b2ac14c46ea74c5b to your computer and use it in GitHub Desktop.
A function to check if a word has repeated characters and tell you if it's an isogram or not
word = input("Please write a word: ")
word = word.lower()
def isIsogram(word):
array = []
for character in word:
if character not in array:
array.append(character)
else:
print("Is not an isogram")
return False
print("Is an isogram")
return True
#This function checks each character in the word
# and adds it to an array if it is not already present.
# If a character is found in the array, it means
# it is a duplicate, and the function returns False.
# If all characters are unique, it returns True.
isIsogram(word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment