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

I just started problem set 0.. and I'm going blank on what to do... What commands should I be doing to ask for information? raw_input?

OpenStudy (e.mccormick):

Yah, 6.00 just sort of drops you in. Here is a good book to go with the class: http://www.greenteapress.com/thinkpython/ The best part is, the PDF version is free.

OpenStudy (e.mccormick):

In there, chapter 4 has: 4.12 Keyboard input That will cover how to use raw_input. Also, it has a nice index, which is very useful for looking up things.

OpenStudy (e.mccormick):

If you end up with a code snippet you want people to look at here, it is best to put it between ``` marks (the one that shares the ~ key.) Three on a seperate line above and below the code block. That causes it to show it as code. ``` >>> name = raw_input ("What...is your name? ") What...is your name? Arthur, King of the Britons! >>> print name Arthur, King of the Britons! ``` Why this is really handy is because it highlights the keywords and it can be properly copied and pasted. Regular text here does not paste back properly. Copy and paste these to see what I mean: ``` import random for i in range(10): x = random.random() print x ``` import random for i in range(10): x = random.random() print x For longer bits of code, it is best to use a code sharing service, like these: http://dpaste.com/ http://pastebin.com/ http://gist.github.com/

OpenStudy (anonymous):

you are going to want to get familiar with the documentation as well. A good place to start is the Tutorial - which should have been installed on your computer - F1 in IDLE http://docs.python.org/2.7/tutorial/index.html http://docs.python.org/2.7/library/functions.html#raw_input

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!