Skip to content

Instantly share code, notes, and snippets.

@Mancek
Last active July 4, 2021 07: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 Mancek/afda22a33ddc925043f80c0864e4d0db to your computer and use it in GitHub Desktop.
Save Mancek/afda22a33ddc925043f80c0864e4d0db to your computer and use it in GitHub Desktop.
Sum odd numbers
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