Infosys interview question

What is "Monkey Patching" in Python? write one line python code to return odd numbers and even numbers separately, given a list of numbers.

Interview Answer

Anonymous

Jun 6, 2018

e_o_l = [3, 4, 77,9] e, o = [x for x in e_o_l if x % 2 == 0], [x for x in e_o_l if x % 2 != 0]