SHARE
TWEET

Task 2

namemkazaza Oct 21st, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = int(input())
  2. b = int(input())
  3. sum_chet = 0
  4. sum_nechet = 0
  5. for i in range(a, b + 1):
  6.     if i % 2 == 0:
  7.         sum_chet += i
  8.     else:
  9.         sum_nechet += i
  10. print(sum_chet - sum_nechet)
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
 
Top