Create a function record function, write a string at the beginning of the function, and store it as a part of the function. this is called a document string, such as creating a function.
The record function writes a string at the beginning of the function and stores it as a part of the function. this is called a document string, as shown in
Def square (x): 'caculates the square of the number x .'
Return x * x
>>> Square. _ doc __
'Caculates the square of the number x .'
Help -- when used in the interactive interpreter, you will get information about the function including its document string, as shown in
>>> Help (square)
Help on function square in module _ main __:
Square (x)
Caculates the square of the number x.
All functions return something: they return None when they are not required to return a value.
Parameter magic
The above is the abstract content of the notes in the basic python tutorial. For more information, see The PHP Chinese website (www.php1.cn )!