-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9264ef9
commit 1451a28
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# # # Going away for the summer to work so wont be uploading frequently | ||
# # A function that adds up a number as it is increased by one | ||
# Seperate variables for the individual growing number and total that is will be added into | ||
# A while loop that adds ones to the number and adds it into the total | ||
|
||
def summation(num): | ||
number = 0 | ||
total = 0 | ||
while number < num: | ||
number += 1 | ||
total += number | ||
return total |