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, and you can view the document directly from the official Python website.
A common approach:
Absolute method ABS (-100), obtained 100;
Max value Method Max (1,2,23,-20,100), get 100;
Data type conversion method int (' 221 '), get digital 221;int (12.344) Get 12;bool (1) Get True,bool () get false
>> int ('123')123>>> int (12.34)12>>> float ( ' 12.34 ' )12.34>>> str (1.23)'1.23'>>> str (+) '+'>>> bool (1) True
The 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 giving the function an "Alias
# variable a points to the ABS function # so you can also call the ABS function by a 1
Use the Python built-in hex() function to convert an integer to a hexadecimal-represented string
Print (Hex (n1+1))
python--Basic Methods (2)