Even sum X92685


Statement
 

pdf   zip

Write a function @even_sum(a, b)@ that gets two integers aa and bb greater than zero and returns the sum of the even integers nn that are not multiple of bb and 0<na0 < n\le a. For instance @even_sum(10, 3)@ is 2+4+8+10=242 + 4 + 8 + 10 = 24.

Sample session

Sample session
>>> even_sum(10, 3)
24
>>> even_sum(15, 1)
0
>>> even_sum(9, 11)
20
>>> even_sum(15, 4)
32
>>> even_sum(15, 2)
0
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python