Polymorphism

Polymorphism is the provision of a single interface for entities of different types.

Python Example

For more Python class related examples, see:

# Define a function that uses parameters which can be of different types.
def print_variables(parameter1, parameter2):
  
    # The str() method is used to normalize all parameters to string values.
    print(str(parameter1), str(parameter2))
  
# Use the function.
print_variables(1, "my string")