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

If I want to assign a variable using ran_input, why doesn't " y= str(ran_input( 'enter y: '))" work?

OpenStudy (anonymous):

Hey, you probably have just mistyped the method ran_input. Type "ran" in the Python Shell and press ctrl+space to see the autocompletion & suggestions of valid methods. You will see the correct method name is "raw_input". By pressing tab the selected method in the suggestion list will be used.

OpenStudy (rsmith6559):

Also note that raw_input() returns a string: >>> y = raw_input( "enter y: " ) enter y: 3456 >>> y '3456' y is a string, not an integer.

OpenStudy (anonymous):

thank you so much t_ec

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!