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

why do we use int(raw_input()) ... direct input() gives runtime error...

OpenStudy (anonymous):

you can use int(input()) as well if you're using python3

OpenStudy (anonymous):

but my question is that why does it gives runtime error....:?

OpenStudy (anonymous):

input() in python 2.x is only intended to accept integers / float. If anything except an integer / float is entered then you will have an error. if you're using python 3.x you should not be getting a error. http://en.wikibooks.org/wiki/Python_Programming/Input_and_output

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!