Menu
Coddy logo textTech

Lesser of two evens

Lesson 1 of 12 in Coddy's Python Interview Series course.

challenge icon

Challenge

Easy

Write a function  lesser_of_two_evens that gets two integer inputs.

And return the lesser of two given numbers if both numbers are even, but return the greater if one or both numbers are odd.


Example:

Input -  2,4

Expected Output -  2

 

Try it yourself

def lesser_of_two_evens(a1, a2):
    # Write code here

All lessons in Python Interview Series