• missunderstanding these assert cases:

Question related to mission Calculator-I

 

I would like to know why the first one gives 2 and the second one 3.

assert calculator("1+2") == "2"
assert calculator("1+2-") == "3"

Thanks in advance :)

33
dig