On 2017-08-05, Ode Idoko via Python-list <python-list@python.org>
wrote:
> Can anyone help with the python code that can add 101, 102,
> 103...2033 please? As I said before, I'm new to python and need
> assistance in this regard. Thanks for always assisting. 

>>> (2033 - 101 + 1) * (101 + 2033) / 2

You could also calculate it with a combination of sum and range
builtins, as others have hinted, and if it's homework that's
probably a good idea.

-- 
Neil Cerutti

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to