Skip to content

Instantly share code, notes, and snippets.

@Irvingutierrez
Created May 7, 2015 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Irvingutierrez/38f4625b7647526deeb7 to your computer and use it in GitHub Desktop.
Save Irvingutierrez/38f4625b7647526deeb7 to your computer and use it in GitHub Desktop.
WSQ07
print("Sum of numbers, Irving Gutierrez")
print()
count=0
sus=0
print("We will calculate the sum of integers in the range you provide")
print()
print("Please give us the lower bound")
lower=int(input())
print("Please give us the upper bound")
upper=int(input())
print()
while lower>upper:
sus=lower
lower=upper
upper=sus
print("You introduced an invalid range of numbers...")
print("But we flipped them for you!!")
print("Lower: ", lower, "Upper: ", upper)
print()
sus=lower
while lower<=upper:
count+=lower
lower+=1
print("The sum of the integer numbers from ", sus, " to ", upper, " is: ", count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment