School Olympics

a guest Oct 23rd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. A=int(input())
  2. B=int(input())
  3. even=0
  4. uneven=0
  5. for n in range (A, B+1):
  6.     if n%2==0:
  7.         even=even+n
  8. for n in range (A, B+1):
  9.     if n%2==1:
  10.         uneven=uneven+n
  11. print(even-uneven)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand