Stuck on Python


#1



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


File "python", line 6
print .isalpha(original)
^
SyntaxError: invalid syntax


print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word:")
if len(original) > 0 and len(original) < 1:
    print .isalpha(original)
else:
        print "empty"


Replace this line with your code.


#2

Hi @skhande2,

This example given in the instructions demonstrates the syntax for calling the isalpha() method ...

x = "J123"
x.isalpha()  # False

You need to use that syntax.


#3

First off, I'm pretty sure isalpha() is a condition that's meant to go in the if statement along with len().

Second, isalpha() isn't run through parameters, but something I believe is called dot notation.

It basically means you follow this syntax: variable.isalpha()


#4

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