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.