Python skipping my if statement
For some reason, this code doesn't work:
def pyglatin(word):
output = ""
wordlenedit = len(word)-1
wordlen = len(word)
fixer = 0
while fixer == 0:
for i in word:
if i == 'a' or i == 'e' or i == 'o' or i == 'i' or i == 'u':
fixer = 1
else:
wordlenedit -= 1
else:
output = word[wordlenedit:wordlen:1] + '-' + word[0:wordlenedit:1]
+ 'ay'
return output
To see the issues, click here. The problem appears to be that it's
skipping the if statement that identifies vowels, but I'm not sure why.
This results in some very odd outputs.
No comments:
Post a Comment