Both @Richard-MacCutchan and I have run your code "as-is" and it does not produce any error.
Which means the problem
must lie with your inputs. If you look at the error message carefully, the runtime thinks that the value input for
b
is a blank string
ValueError: invalid literal for int() with base 10: ''
So it seems the difference between your debug environment and runtime environment is how it is interpreting the CRLF between your inputs OR you are hitting enter twice after entering each of the values (this was the only way I could get it to fail)
There was a bug some time back where the
input()
function put an extra
'\r'
character onto the input, that would possibly have this effect. To see if that is what is happening try changing your code to the following to see what comes out between the !! characters
a = input()
b = input()
print("!" + a + "!")
print("!" + b + "!")
If it comes out like below then you have that bug
!10!
!!
That bug has now been fixed, so make sure you have the most recent version of Python.
Edit: Or you could use an alternative method of getting the data - e.g.
raw_input()