Convert them to integers:
legs = int(raw_input("How many legs do you have? "))
arms = int(raw_input("And how many arms do you have? "))
At the moment they are strings, this is the default datatype from raw_input.
>>> example = raw_input()
2
>>> type(example)
<class 'str'>
When you add two strings together (right there you have '2'
and '2'
), Python just concatenates them into one single string. (So in that case it will result in '22'
)
>>> '2' + '2'
'22'
It should now give the correct result.
A minimal example of what the fixed version does:
>>> legs = int(raw_input())
2
>>> arms = int(raw_input())
2
>>> limbs = legs + arms
>>> limbs
4
You can now pass that to the function without trouble.