0

So I have been trying to remove vowels from a Word in python. According to the programming logic, it should do just fine. Can't find the problem.

def disemvowel(word):
    b = ['a', 'e', 'i', 'o', 'u']
    try:
        a = list(word)
    except ValueError:
        print("{} is not a word.".format(word))
    else:
        for words in a:
            for vowels in b:
                if words.lower() == vowels:
                    a.remove(words)
        word = ", ".join(a)
    return word


m = input("Enter word:")
print(disemvowel(m))
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895

0 Answers0