Pig Latin up to pop quiz


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/0/6?curriculum_id=4f89dab3d788890003000096 < exercice link


Hello!
i m kind of having a wierd problem, seeing as the site is saying my code is correct and letting me proceeed but something is wrong.
okay, so the problem is that after i type in a word, be it just letters, numbers or leving it empty and hit enter nothing really happens, until i hit enter again, but then it´s empty, so i get the empty return. so i don´t really know what i´m doing wrong. Edit: if i type the word twice it works, but it isn´t supposed to be like that, is it?
any help would be much appreciated!

heres 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
else:
    print "empty"


#2

you should store the result of raw_input() in original:

original =raw_input('Enter a word:')

you have two raw_inputs, you only need one


#3

1- You want to affect to original the input of the user when the computer printout Enter a word: so the syntaxe is original = raw_input('Enter a word:') not :

2- It's preferable to use more parentheses... Eg: if ((cond1) and (cond2)):


#4

thanks a lot! working now


#5

thanks again! its working now


#6

why on earth are more parentheses preferable?

original is absolutely a variable, it is where you store the user input from raw_input


#7

you are misunderstanding...
1- I say 'original' is not a variable original do! 'original' is a string or I'm i wrong Mr/Miss @stetim94 ?!
2- Parentheses makes you avoid unexpected errors!


#8

'original' is a string not a variable... is what you said, but in all cases here it should be a variable, as it is done right by mzreaper, what you say here might cause confusen

With parentheses you actually reduce readability, and with such simple conditions you really don't need them


#9

think there might be a little confusion here as i removed the '' from original in an edit, maybe after response


#10

Thanks @mzreaper. @stetim94 :rolling_eyes:


#11

i didn't see that edit, the moment i looked at the line it was correct