Last active
July 4, 2021 07:43
-
-
Save Mancek/afda22a33ddc925043f80c0864e4d0db to your computer and use it in GitHub Desktop.
Sum odd numbers
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
def sumOdd(lowerLimit, upperlimit): | |
return sum(range(lowerLimit if lowerLimit%2 else lowerLimit+1,upperLimit,2)) | |
lowerLimit = int(input()) | |
upperLimit = int(input()) | |
print (sumOdd(lowerLimit,upperLimit)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment