Function overloading PREMIUM

Series: Functions
Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
4 min. read 3 min. video Python 3.8—3.12

Python doesn't have function overloading.

Instead of overloading we have overwriting

What if we have a function that we'd like to use with different arguments depending on the situation?

For example, we'd like to make a greet function that can be called with nothing or can be called with a single argument:


A Python Tip Every Week

Need to fill-in gaps in your Python skills? I send weekly emails designed to do just that.