Python has built in a lot of useful functions that we can call directly.
To invoke a function, you need to know the name and parameters of the function, such as a function that asks for an absolute value abs , and only one argument. Documents can be viewed directly from the official Python website:
Http://docs.python.org/3/library/functions.html#abs
You can also help(abs) view the abs function's help information on the interactive command line.
1. Call
abs function:
>>> ABS (100>>>) abs ( -20)20>>> abs (12.34)12.34
2. Data type conversion
Python's built-in common functions also include data type conversion functions, such as int() functions that convert other data types to integers:
>>> int ('123')123>>> int (12.34)12>>> Float ('12.34')12.34>>> str (1.23)'1.23 '>>> str ' [+]>>> bool (1 ) True>>> bool (") False
3, function name is actually a reference to a function object, it is possible to assign a function name to a variable, which is equivalent to the function of an "alias"
# variable a points to the ABS function # so you can also call the ABS function by a 1
Reprinted from: Https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/ 0014316784721058975e02b46cc45cb836bb0827607738d000
function Call of Python function