My method is being recognized within my own program. Newbie mistake probably.
- by Sergio Tapia
Here's my code:
sentenceToTranslate = raw_input("Please write in the sentence you want to translate: ")
words = sentenceToTranslate.split(" ")
for word in words:
if isVowel(word[0]):
print "TEST"
def isVowel(letter):
if letter.lower() == "a" or letter.lower() == "e" or letter.lower() == "i" or letter.lower() == "o" or letter.lower() == "u":
return True
else:
return False
The error I get is:
NameError: name 'isVowel' is not defined
What am I doing wrong?