Created
March 3, 2015 01:30
-
-
Save gilrg18/d44ef75afa645e2ae1e8 to your computer and use it in GitHub Desktop.
wsq07.py
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("We will calculate the sum of integers in the range you provide") | |
result= 0 | |
num1=int(input("Please give us the lower bound:")) | |
num2=int(input("Please give us the upper bound:")) | |
while num1>num2: | |
print ("User input error, please give us the numbers again") | |
num1=int(input("Please give us the lower bound:")) | |
num2=int(input("Please give us the upper bound:")) | |
while num1<num2 : | |
result=result + num1 | |
num1=num1+1 | |
result=result+num1 | |
print ("The sum from your lower bound to your upper bound is",result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment