Pyg Latin #11


#1

https://www.codecademy.com/en/courses/python-beginner-2W5v7/1/5?curriculum_id=4f89dab3d788890003000096

The pyg latin translator isn’t properly functioning it doesn’t deliver any outputs.



pyg = 'ay'

original = raw_input('Enter a word:')

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



#2

What do you mean by that? Do you mean it’s not printing anything? Well that’s because you haven’t used a print statement to do so. You used it just fine in your else statement.


#3

i just added print “original” to line 4 but it said name ‘word’ is not defined and to file ‘python’ in line 6


#4

Yes, this means we didn’t declare word before our new_word variable/reassignments. So both first and word should of been declared before that (new_word). Basically, those two variables didn’t exist until a couple lines later. Always check the error code you’re given, it helps/shows you how to fix your problem. :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.