Ask your own question, for FREE!
Computer Science 5 Online
OpenStudy (anonymous):

If I ask for a raw_input in python, is it possible to make the program react in different ways depending if the input can be converted into an integer or not? I've tried things like: ans = raw_input('Enter number') if type(int(ans)) == int: ......

OpenStudy (turingtest):

Learn about exceptions to handle type error like this https://www.edx.org/courses/MITx/6.00x/2012_Fall/book/0/

OpenStudy (anonymous):

Thanks, that has helped quite a bit

OpenStudy (turingtest):

welcome!

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!