Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Summation and Double Summation examples for the Loops post @
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