SHARE
TWEET

Untitled

a guest Feb 16th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #n = (int(input("please enter the first number in your range: ")))
  2. #m = (int(input("please enter the second number in your range: ")))
  3.  
  4. n = 5
  5. m = 10
  6.  
  7. even = 0
  8. odd = 0
  9.  
  10. range_num = n
  11.  
  12. for x in range(n,m+1):
  13.  
  14.     if range_num%2 == 0:
  15.         even += range_num
  16.         range_num += 1
  17.     else:
  18.         odd += range_num
  19.         range_num += 1
  20.  
  21. print(even)
  22. print(odd)
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