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

I just watched lecture 2 and I missed the significance of the two Input types: Raw Input and Input. Could anybody care to explain what these are in further detail? Much appreciated!

OpenStudy (anonymous):

I can't remember why exactly, but you want to use raw_input most of the time. This might help: http://docs.python.org/library/functions.html#input From what I recall, Python 3 will use input('prompt') to do what raw_input('prompt') does in Python 2. The reason why we still use Python 2 is that Python 3 changes break a lot of existing Python 2 code.

OpenStudy (anonymous):

thanks!

OpenStudy (anonymous):

In python 2.x raw_input takes all the prompt as "strings" and input as "integers". Like ryananthony said what raw_input does now it is the same as input actually do in python 3.x. I encourage you to use python 3.x! True that not all of the libraries they're available in 2.x they are in 3.x but most of them they do and Yes 3.x is constantly changing but not the syntax or the way it works just it is raising for better!

OpenStudy (anonymous):

unlike input raw_input interprets everything as a string...suppose you wanna input a float then you have convert the raw input this way: y=float(raw_input('enter a number')). input has been wiped out if you see the new versions of IDE. Forget about input. :P

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!