First, welcome to the forum!
What 'slate' is really telling you is that input() is for numbers and raw_input() is for strings. Using input() has certain risks since you can also enter a command and it will excute it.
Anyway, if you want to use
op = input(">")
then op will not be a string
and you have to use this if statement
if op == 1:
In the matter of fact, input() allows you to create this very simple calculator, since it evaluates mathematical expressions directly:
print "At the >> prompt enter x op y"
print "where x and y are numbers and op is"
print "- + / * ** // for instance 12 * 9"
result = input(">> ")
print "result =", result
Last edited by sneekula; Jun 7th, 2008 at 11:23 am.
Reputation Points: 961
Solved Threads: 211
Nearly a Posting Maven
Offline 2,413 posts
since Oct 2006