Stuck InPython: 3- Conditionals and control flow. PygLatin Part 1. 5.-Check yourself... Some more


I can only post one picture so im posting the error.
Here is the link to the excercise so you can see it

Apparently the function ".isalpha()" "has no attribute".

I expected the excercise to be done and correct.

Here is the error

Below is my code

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input("Enter a word:")

original = raw_input

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

    print "empty"


Well you are missing a very important statement between your original = raw_input and your if statement. It has to do with the original as well. If you need more of a hint just respond back as so


Do i need to define that original contains charachters with has_chars() function?
Or am i missing something else
ty btw


Not quite. You are not checking the characters but of word but making sure that the word you type into the raw input will be put on the screen and then processed. Might not be the best explanation but it should lead you into the right direction. Basically, you need original to equal something else that will help that to happen.


i just changed the line 6
added () at the end of raw_input


Huh. Missed that good find! :smiley:


@dchurchw , if after making that change, you now have this as part of your code ...

raw_input("Enter a word:")

original = raw_input()

... you should consider making an additional revision to your code. With the above statements, notice how many times you need to hit the enter (return) key when you run the program.


hmm, two.
it seems like teh first time i press enter, the text in tehre doesnt matter, the second one is the one that makes teh program print its value, or empty



Do you understand why that happens? What could be done to correct that?

See the documentation at Python 2: raw_input.


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