Question: Here is the question: Even Odd Split (25 pts) Please write a function named is evenodd split which takes an integer (and option- ally a
Here is the question:
Even Odd Split (25 pts)
Please write a function named is evenodd split which takes an integer (and option- ally a bool) as input. If the parameter even on left is True by default, the function should return true if all even numbers are on left side and all odd numbers on right side. If the parameter even on left is False, the function should return true if all odd numbers are on left side and all even numbers on right side.
1.1 Examples
# Input: Integer x | Output: boolean
# e.g. x = 14356 | False (1 is left of 4)
# e.g. x = 246193 | True (Note: split does not need to be down the middle)
# e.g. x = 2419735, even_on_left = False | False (even numbers should be on the right)
# e.g. x = 5379142, even_on_left = False | True
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
