You need this to get the sum:
ans = number1 + number2
Or is this not what you wanted to do?
Since you commented: the numbers in between are 3,4,5
, do you mean this?
>>> for i in range(number1+1,number2):
... print i
...
3
4
5
EDIT:
So, OP also needs sum of all numbers between two numbers:
>>> number1 = 2
>>> number2 = 6
>>> sum(range(number1 + 1, number2))
12
This second part given by OP.