Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Summation and Double Summation examples for the Loops post @ http://nitstorm.github.io/blog/
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
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
You can’t perform that action at this time.