Created
May 7, 2015 00:43
-
-
Save Irvingutierrez/38f4625b7647526deeb7 to your computer and use it in GitHub Desktop.
WSQ07
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
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