Jupyter Notebook on Google Colab: https://tinyurl.com/5awxwpn3
(Bioinfo track: https://tinyurl.com/yckxbptr )
We compute the sum total of an unknown number of values using an "accumulator" variable to keep a running total. A "while" loop is a natural choice in this case, as it allows us to go around for more input until the user says stop.
Embedded video, part of the following courses:
Computer Programming at Queen Mary, University of London
Coding for Scientists at Queen Mary, University of London
For the full context, see the notebooks linked above.