Sum the even number in the given range



Problem to sum the even numbers from n to m.



Example-1:


Input    : n = 10  m = 20
Output   : 90
Explain  : 10 + 12 + 14 + 16 + 18 + 20 = 90  


Example-2:


Input    : n = 5  m = 10
Output   : 24
Explain  : 6 + 8 + 10 = 24  







Solution




n = 10

m = 20

k = 0

for i in range(n,m+1):

    if(i % 2 == 0):

        k += i

print(k)



Output



90