0

I am trying to make my first program in Python, however, I am having a problem.

Why is op1 not being assigned the value I input?

print ("Hello user")
num1 = int(input("Choose a number: "))
num2 = int(input("Choose another number: "))
op1 = (input("Choose an operation [add, multiply, minus, divide]: "))
print (op1)

No matter what I enter into op1 I always receive this message from print (op1):

<function add at 0x10cff1938>
eush77
  • 3,870
  • 1
  • 23
  • 30
dandannn
  • 1
  • 2

1 Answers1

1

If you're using Python 2.7._, then if you're reading in strings, you need to use raw_input instead of input.

Also discussed here.

Community
  • 1
  • 1