Created
December 31, 2013 19:55
-
-
Save nitstorm/8201516 to your computer and use it in GitHub Desktop.
Summation and Double Summation examples for the Loops post @ http://nitstorm.github.io/blog/
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
x = int(input("Enter x upper limit:")) | |
y = int(input("Enter y upper limit:")) | |
total = 0 | |
i,j = 1,1 | |
while i <= y: | |
while j <= x: | |
total = total + (x*y) | |
j += 1 | |
i += 1 | |
print total |
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
total = 0 | |
for n in range(1,100): | |
total = total + (2*n) | |
print total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment