Member-only story
Understand Function in Python
Today I gonna learn to use functions in Python as a series of learning Python from Scratch. Before I search any tutorials, my goals are to know the following questions:
- How to define a function?
- Does the language support function overloading?
- How to set default params?
- How to write a high-order function?
- Can I use closure?
With these questions in mind, I started googling the keywords:
python function
Here are what I learned.
How to define a function?
We can use def
to define a function:
Does Python support function overloading?
No. Python is dynamically language, function overloading is not necessory.