Even Collection
EasyP3Coding
Return the sum of all even integers in the inclusive range [lo, hi]. Return 0 if there are none.
Example 1
- Input
- lo = 1, hi = 10
- Output
- 30
Example 2
- Input
- lo = 2, hi = 2
- Output
- 2
Example 3
- Input
- lo = 3, hi = 3
- Output
- 0
Constraints
- -10^6 <= lo <= hi <= 10^6
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 8. ⌘Enter runs, ⌘⇧Enter submits.