Why is my Translator Not Changing the Word?


#1

My Pig Latin translator does not work.

Here is my code.
print ‘pig latin’

pyg = ‘ay’

original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]
print original
else:
print ‘empty’

All it does is just output whatever word I type in. No ‘ay’ or letter moving…no nothing.

Please advise. Anyone.


How can I know if my translator works properly?
#2

Yeah see theres one error at the end
Its when you wrote print Original (at the end of the if statement)
You’re supposed to write print new_word as thats [original] with all the modifications


#3

Thanks for you help i was stuck now my program is working just fine…


#4

2 posts were split to a new topic: No Place to Input Word


#5

A post was split to a new topic: This Pig Latin is Incorrect