Use sum
>>> sum(range(49999951,50000000))
2449998775L
It is a builtin function, Which means you don't need to import anything or do anything special to use it. you should always consult the documentation, or the tutorials before you come asking here, in case it already exists - also, StackOverflow has a search function that could have helped you find an answer to your problem as well.
The sum
function in this case, takes a list of integers, and incrementally adds them to eachother, in a similar fashion as below:
>>> total = 0
>>> for i in range(49999951,50000000):
total += i
>>> total
2449998775L
Also - similar to Reduce
:
>>> reduce(lambda x,y: x+y, range(49999951,50000000))
2449998775L