mRyan mRyan - 1 year ago 129
Python Question

Adding two int's

why can't I add these together?

a = int(input("input a number to add"))
b = int(input("input a number to add"))
a + b = c

can't assign to operator

Answer Source

you can't do a+b=c you should do c=a+b because you can't give the non existing value c to something named a+b (when you do c = a + b you assign the result of the operation "a+b" in a variable named "c".)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download