FAQ: Learn Python - Pyglatin - Pop Quiz!

This community-built FAQ covers the “Pop Quiz!” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise Pop Quiz!:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

My code is not working well: here it is:

if len(original) > 0 and original.isalpha:
      print "original"
    else: 
      print "emptyl"
    ```
Here is my output when I enter a word:

Welcome to the Pig Latin Translator!
Enter a word: 5rot2
empty
original

I entered a word with strings and numbers (5rot2) and it printed both the if conditional statement and the else! Can anyone please show me what is wrong with the code? 
I will appreciate some enlightenment, please and thanks in advance.
  1. It won’t work at all if else is actually indented like that
  2. You need to include parentheses following isalpha like this: original.isalpha()

Without the parentheses, original.isalpha returns the method isalpha, but does not run it.

original = 'abc'

print(original.isalpha)

print(original.isalpha())

Output:

<built-in method isalpha of str object at 0x006A02C0>
True

As a predicate to if, original.isalpha (no parentheses) will always return True!

Thanks for your help, Patrick and I can now see my error.

there is no hints, no cheatsheet, even if i click solution then run keep failing code need help

print ‘Welcome to the Pig Latin Translator!’
original = raw_input(“Enter a word:”)
if len(original) > 0 and original.isalpha():
print original
else:
print “empty”

Welcome to the Pig Latin Translator!
Enter a word:Traceback (most recent call last):
File “python”, line 4, in
ExecTimeoutException: Program took too long to terminate.

Hello @alfonsoreyes20680686 and welcome to the Codecademy Forums!

Check out this topic and then this one to see if either one fixes the problem.

It’s happening this error from 3/11 I think…when you click on RUN…and it’s says ENTER A WORD (on the right window)…first click in the left window…then click in the right window ( where it’s says ENTER A WORD) there you would be able to write a word and press ENTER. There the code it’s gonna run whithout problem.
To continue testing the code…just do the same over and over again.

1 Like

Lesson bugged. pressed run and enter the word in the console but it says :
Traceback (most recent call last):
File “python”, line 4, in
ExecTimeoutException: Program took too long to terminate.

I have been using solutions to proceed all this time.

1 Like

Maybe try some of the solutions others have offered in the following topic.

Alternatively, you can assign original to the value of a string containing the word you would have entered through the console.