Python - Polymorphism and Dynamic Behavior
What is the output of this code?
def operate(x, y):
if isinstance(x, str) and isinstance(y, str):
return x + y
elif isinstance(x, int) and isinstance(y, int):
return x * y
else:
return None
print(operate('Hi', 'There'))
print(operate(3, 4))
print(operate('Hi', 4))