Last active
August 29, 2015 14:28
-
-
Save e-parkinson/21ac315f9590cc3aab0b to your computer and use it in GitHub Desktop.
Snippet:
find sum of natural numbers to n inclusive using iteration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = int(input()) | |
| running_total = 0 | |
| for i in range(0,n+1): | |
| running_total += i | |
| print(running_total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment