Python - Polymorphism and Dynamic Behavior
Consider this polymorphic function:
def combine(a, b):
if isinstance(a, dict) and isinstance(b, dict):
return {**a, **b}
elif isinstance(a, list) and isinstance(b, list):
return a + b
else:
return str(a) + str(b)
What is the output of combine({'x':1}, {'y':2}) and combine([1,2], [3,4])?