environment windows7 (I want a Mac Book Pro 16inch) Visual Studio Code chrome python ver3.8.3
This article is written for beginners in programming and Python.
Function ... Is that what you learned in junior high school? Or is it delicious like mackerel?
Yes, the correct answer is like that I learned in junior high school.
func.py
y=f(x)
Nostalgia makes my heart warm. So what is a function? According to weblio, what is a function?
Function How to read: Function [English] function A function is a set of mathematical formulas or instructions that perform a certain amount of calculation on an input value and return the processing result according to the input value.
It is that. I have a lot of memories back. However, it is still difficult to understand, so let's change the words as follows.
function
How to read: Function
[English] function
A function is a set of mathematical formulas or commands that perform a certain amount of cooking on an input ingredient and return a cooking result according to the input ingredient. ..
To put this in a simpler analogy, I think we can say this.
ingredients in staubFirst, put the ingredients in the staub (pot). Potatoes, carrots, meat, roux, etc.
cookingHeat the pot to cook the ingredients in the staub.
cooking called curryYes. The delicious curry cooking is ready.
In other words
y=f(x)
This is
Cooking = Cooking (Ingredients)It's rough, but let's replace it.
If you cook the ingredients, it becomes a cooking.
Well, based on this, I will go next.
Cooking = Cooking (Ingredients)Cooking is a variable. Ingredients is an argument. Cooking is a function. This is a Python function.
Continue
Recommended Posts