Stuck at pig latin translator


#1

what is the error


#2

your code is wrong, remember, if you want to get some thing should be input that into a variable.
that means: raw_input should be insert after original=
then...

.isalpha() is an string method. you must insert string or variable of string before .isalpha()
for example: "hello".isalpha()


#3

please write the line of the code after correcting it


#4

please reply

if somebody can write incorrect line correctly


#5

original = raw_input("Enter a word: ")
if len(original) > 0 and original.isalpha():
    print "word"
else:
    print "empty"

test it


#6

i did that but dosent work


#7

please help me out!!!


#8

too bad, the asks not say print original.

original = raw_input("Enter a word:")
if len(original) > 0 and original.isalpha():
    print original
else:
    print " not alpha!:/"

and is should say in this part 1 condition is work. not need 2 condition :confused:


#9

thanks a lot it worked:slight_smile:


#10

if i was wrong in
original = raw_input("Enter a word:")
then how did this code ran successful


#11

any answer please!!!


#12

be patient my friends,

your code is correct to work, but not perfect.

the asks in your lesson is about if else. check bottom of left sidebar.

your if condition return True. because, your original = "Enter a word:" (is an string) and your condition is len of original > 0 --> this is True. and instructions may want from you that use if and else in your code. check it again.


#13

sorry! but just now i am dealing with another problem in the next lesson. it trows the following error.

can you please write the incorrect or missing line


#14

instructions part


#15