I have recently started learning how to program in Python using the site Codecademy.com, and it uses Python 2.7, and while I have installed both 2.7.3 and 3.3.2 on my computer I am creating the program in Python 3.
The program itself is a simple little proof of concept from the lessons on the site, a Pig Latin translator. I have decided to take it a step further and develop it to work on entire paragraphs of text, including spaces and other such instances, instead of only one word which is what the program originally did.
My problem at the moment is that the program is only outputting the same thing no matter what I put through, and I don't know why.
It only outputs the 'This isn't finished yet.' print of the code, which is for the instance of multiple words, obviously not done yet.
Here's the code:
pyg = 'ay'
raw_input = input('Enter your text here. Numbers are not allowed. ')
if len(raw_input) > 0 and raw_input.replace(' ', '').isalpha:
lower_input = raw_input.lower()
if lower_input[0] == " ":
lower_input = lower_input[1:]
word_spacing = lower_input.replace(' ', '/')
if word_spacing.find('/'):
print('This isn\'t finished yet.')
else:
first_letter = raw_input[0]
if first_letter == 'a' or 'e' or 'i' or 'o' or 'u':
output = raw_input[1].upper() + raw_input[2:] + first_letter + pyg
print(output)
else:
output = raw_input[0].upper() + raw_input[1:] + pyg
print(output)
else:
print('The text you entered is invalid.')
end = input('Press Enter to exit')
If somebody could read over the code and help me debug this, that would be really helpful. Been staring at it for a while and still don't get it.