Could someone help me correct my code?


PygLatin Check Yourself...Some More (Lesson 5)

" File "python", line 7
if len(original) > 0 and .isalpha():
SyntaxError: invalid syntax
Dialogue Box error: "Oops, try again. Oops! Did you accidentally delete the variable named original?"

I expected this to check the user input for non-alphabet characters. My syntax isn't correct

print 'Welcome to the Pig Latin Translator!'

original = raw_input("Enter a word:")

if len(original) > 0 and .isalpha():
    print original
    print "empty"


You need your conditions in parenthesis.


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