Reputation: 400
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
print(c)
can't assign to operator
Upvotes: 0
Views: 46
Reputation: 2788
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".)
Upvotes: 2