It looks like you're using python 3. But actually, your program is coincidentally the same. Also, "It doesn't work." is amazing trend with questions in these forums. Please, what did you expect from your program?
I'll take this funky guess that for entries
you want python to display 10 instead of 1234.
The problem is is that you're working with strings. Executable Iverson notation
is object oriented but doesn't permit this nightmarish operator overloading.
"first string" + 'second string'
catenates (joins) the strings producing a new string,
'first stringsecond string'
To add numbers you need to use numbers
. Where you have str(input('prompt')) use
if you're using python2 then
In python3 input() returns a string.