Python #function 2 for super beginners

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 2

Last time

Variable = function (argument)

It ended with. However, if you proceed with the function as it is, there is a risk that the understanding will not be deepened, so I will stop here.

What I've pulled out today is this, a function that even beginners can't avoid.

func.py


print('Hello World')
#Hello World

Yes, this print () is also a function. Moreover, even if you don't have the ○○ dish and the variable name, it will cook if you add the ingredients.

This print function is called a built-in function in Python. How many are there in Python? Python official website: Types and usage of built-in functions has the types and usage. There are many more than I expected, but I think I will remember them as I progress through my studies, so I don't have to force myself to remember them.

It gets a little confusing from here, but please remember it as a trivia. It's a very programming way of thinking and I personally like it.

print function does not return a return value

A normal function returns a return value and assigns it to a variable. But the print function is

func.py



print('Hello World')
#Just print Hello World and there is no return value

It says that there is no return value, but in fact, the print function also returns the return value. What are you returning as a return value? that is None It is non, not read as "none". In other words, no is returned as a return value. Mr. A "Mr. B, please return the loaned money" Mr. B "Mr. A, I'm sorry. I'll return 0 yen." In other words, we are having such a barren exchange. So there is no return value. That's why.

fin

Recommended Posts

Python #function 2 for super beginners
Python #len function for super beginners
Python for super beginners Python #functions 1
Python #list for super beginners
Python #index for super beginners, slices
Python #Hello World for super beginners
Python for super beginners Python # dictionary type 2 for super beginners
Let's put together Python for super beginners
python textbook for beginners
OpenCV for Python beginners
Python for super beginners Python for super beginners # Easy to get angry
Easy understanding of Python for & arrays (for super beginners)
About Python external module import <For super beginners>
About python beginner's memorandum function
Python3 environment construction (for beginners)
Basic Python grammar for beginners
100 Pandas knocks for Python beginners
~ Tips for beginners to Python ③ ~
How to convert Python # type for Python super beginners: str
python function ①
[Python] function
Python # How to check type and type for super beginners
python function ②
Python Exercise for Beginners # 2 [for Statement / While Statement]
<For beginners> python library <For machine learning>
Beginners use Python for web scraping (1)
[Python] Reasons for overriding using super ()
Run unittests in Python (for beginners)
Beginners use Python for web scraping (4) ―― 1
How to convert Python # type for Python super beginners: int, float
2016-10-30 else for Python3> for:
python [for myself]
INSERT into MySQL with Python [For beginners]
[Kaggle for super beginners] Titanic (Logistic regression)
[Python] Minutes of study meeting for beginners (7/15)
python enumerate function
Roadmap for beginners
Python> function> Closure
[Python] Generator function
[Python] Read images with OpenCV (for beginners)
Python> function> Inner function
WebApi creation with Python (CRUD creation) For beginners
Beginners practice Python
Python function decorator
Python beginner's note
Atcoder standard input set for beginners (python)
[For beginners] Try web scraping with Python
A textbook for beginners made by Python beginners
Notes for Python beginners with experience in other languages 12 (+1) items by function
Memo # 4 for Python beginners to read "Detailed Python Grammar"
The fastest way for beginners to master Python
[Python] I tried substituting the function name for the function name
Causal reasoning and causal search with Python (for beginners)
For new students (Recommended efforts for Python beginners Part 1)
Memo # 3 for Python beginners to read "Detailed Python Grammar"
Memo # 1 for Python beginners to read "Detailed Python Grammar"
~ Tips for Python beginners from Pythonista with love ① ~
Understand Python for Pepper development. -Python box self-made function-
Note for formatting numbers with python format function
Try to calculate RPN in Python (for beginners)
Memo # 2 for Python beginners to read "Detailed Python Grammar"