Lesser of two evens
Lesson 1 of 12 in Coddy's Python Interview Series course.
Challenge
EasyWrite 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 hereAll lessons in Python Interview Series
1Crack Python Coding Interview
Lesser of two evensPangram Unique ElementsAnimal CrackersSpy GameMatching StringPalindrome or NotBlackJackFind DuplicatesEncodeHash 33First Non-Repeating Character