FAQ: PygLatin - Word Up

what if you run your code on repl.it? Does that work?

It doesn’t. I went on ‘view solution’ and ran that code on repl.it. That doesn’t work either.

Also times out? Or what? Did you run the right python version? Or do you get a different error?

Are you having problem with using the prompt in the lesson? Or on repl? Or both?

Turns out it was the wrong Python version on repl.it. I ran it with the correct version, and it works.
I think it’s something with the lesson, it’s happening with every lesson in PygLatin.

yea, seems to be

if len(original) > 0 and original.isalpha():
  print original.lower()
  word = original.lower
  first = word[0]
else:
  print 'empty'

When I try first = word[0] , there is a bug that says: “Did you create a variable called first?”
Do you know how to fix this bug? Thanks!

I’d suggest printing out the intermediate names in that chunk of code so you know exactly what’s going on at each step (is your logic being correctly applied to the code).

Hi> i have tried several times and even had to ask for the solution. it gets to the point where i input my word into the console but then after it leaves an error message even though the code is correct. i know this because it is codecademy’s solution. this is the error message i keep getting;
Traceback (most recent call last):
File “python”, line 3, in
ExecTimeoutException: Program took too long to terminate.

exactly the same problem i have.

Welcome to the forums!

Did you enter a value into the console after clicking “Run”? Alternatively, you can check out this topic or this one for possible solutions.

thank you for your response. yes i did

I’m having the same issue.
What’s the difference between mine and what’s supposedly correct?

My code:

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]

else:
    print 'empty'

System “correct” code:

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
  word = original.lower()
  first = word[0]

else:
    print 'empty'

Same thing happened to me and so far it has happened in every lesson for the Pyg Latin section. I planned on trying to run the code on a different website. Did you ever end up figuring it out?

pyg = ‘ay’

original = raw_input(“Enter a word”)

word = original.lower( )

first = word [0]

if len(original) > 0 and original.isalpha() :
print (original, word, first)
else:
print “empty”

This is my code and it runs perfectly.

print ‘Welcome to the Pig Latin Translator!’

Start coding here!

original = raw_input(“Enter a word:”)
if len(original) > 0 and original.isalpha() :
word = original.lower()
print “courage”
else:
print “The time has come for you to test the limits of your courage.”

first = original[0]
second = original[1]
third = original[2]

It’s not showing the first letter of my word. I looked everywhere trying to solve this.

why do you expect to see the first letter of my word?

I only see you print courage