Created
December 18, 2020 03:45
-
-
Save ayubmetah/bf0ad0270d5b433830fbcf5c7e3eb987 to your computer and use it in GitHub Desktop.
Adding values in a loop
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
values = [23, 52, 59, 37, 48] | |
sum = 0 | |
length =0 | |
for value in values: | |
sum += value | |
length += 1 | |
print("Total sum: " + str(sum) + " - Average: " + str(sum/length)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment