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

hey i need some help. i'm writing a pretty basic program in python that calculates basic arithmatic. it prompts the user for the operator they want to use. but in the event the user inputs an invalid operator i need a way to correct this.

OpenStudy (rsmith6559):

operators = [ '+', '-', '*', '/' ] operator = '' while( operator not in operators ): operator = raw_input( "Enter an operator ( + - * / ): " ) if( operator not in operators ): print "Try again stupid" It wasn't a good day.

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!