Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (blackstreet23):

A PYTHON question: Hey guys and gals, I am wondering how can i make a variable where i can input integers and also strings without getting an error. I need to do this : d. Type of meal chosen (possible input is (1, R, or r),(2,D, or d), (3,U,or u)) e. Type of room chosen (possible input is (1, S, or s),(2,E, or e), (3,c,or c)) I need to do a program that can accept those inputs in those variables, how do i do that?

OpenStudy (anonymous):

well x = raw_input('this will prompt will allow you to enter numbers strings or whatever') but the numbers would be as a string until you changed them to int. I would need to know exactly what it is you are trying to do in order to be of better assistance.

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!