The traditional way of defining functions is as follows
def F1 (): return 123
Lambda expression definition function
Lambda : 123
Python3 built-in functions
1.abs Absolute Value
i = ABS ( -11)print (i)
The output is 11.
ABS = Absolute
2,all loop parameter, returns True if each element is true
R = All ([true, True])print (r)
In Python 0 () [] ' and none are false (Null values are false)
R = All (["123","" ", [up],""])print (r)
Return to False
3,any as long as one is true
i = any ([None,"","123"])print (i)
Return to True
4,ASCII automatically executes ASCII (object) to the class of the object, look for __reper__, get the return value
class Foo: def __repr__ (self): return " Hello " == ASCII (obj)print (r)
The return value is Hello
5,bin () binary Oct () octal int () decimal hex () hex
6,bool judge true or false: essentially converts an object to a Boolean value
7,bytes (bytes) bytesarray (byte list)
Complement the conversion between bytes and strings
Bytes ("xxxxx", encoding= "Uft-8")
8,CHR () Ord ()
c = Chr (65)
Print (c)
The return value is a
Chr finds the corresponding ASCII code character (ASCII is a character corresponding to a byte)
Same as Ord (a)
Returns 97 converts a character to a number by Ord
Lambda expression +python built-in functions