Using a while loop and an accumulator variable to sum an unknown number of inputs

Published: 25 September 2023
on channel: PatchyPython
117
0

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.


Watch video Using a while loop and an accumulator variable to sum an unknown number of inputs online without registration, duration hours minute second in high quality. This video was added by user PatchyPython 25 September 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 117 once and liked it 0 people.