Hello. I was playing around with the PygLatin translator when I got stuck. I can't see what is wrong with my code,and I hope someone else can help me to debug this.
For example, when I input JimM9, I got the error messsage:
Traceback (most recent call last):
File "python", line 14, in
NameError: name 'new_word2' is not defined
This is my code:
yg = 'ay' original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): word = original.lower() first = word new_word = word[1:len(new_word)] + first + pyg print new_word else: word2 = original.upper() second = word2 new_word2 = word2[1:len(new_word2)] + second + pyg print new_word2
Thanks in advance!