Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 10 Online
OpenStudy (anonymous):

this is embarrassing but i can't figure out problem set 0. i can get the computer to ask both questions and have the user input the data, but i can't figure out to store the input data in order to recall and reverse it. HELP!

OpenStudy (anonymous):

You do realize that when you enter something like: a = raw_input("Your question here: ") the variable a contains the user input. To print the data, simply use: print a

OpenStudy (anonymous):

but aren't u supposed to create a code that asks two questions then reverses the answers all in one step?

OpenStudy (anonymous):

Sure, but you can store two variables and then print them both. I don't think the aim of the exercise is to make a one-liner.

OpenStudy (anonymous):

Like this: http://pastebin.com/1bChMqXJ

OpenStudy (anonymous):

ooooooooooh ok. i was trying to do the whole thing in one step. thanks

OpenStudy (anonymous):

No problem.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!