Python standard library: built-in function any (iterable), pythoniterable
If one of all elements of an object that can be iterated is True, True is returned. Otherwise, False is returned. Or if the iteratable object is null, False is returned. This function is mainly used to determine whether the list, tuples, dictionaries, and other objects have elements that are True, improving the computing speed. The equivalent code is as follows:
Def any (iterable ):
For element in iterable:
If element:
Return True
Return False
Example:
# Any () function a = [] B = {} c = (1, 3, 4) d = (None, 1, 3) print ('a :', any (a), 'B:', any (B), 'c: ', any (c), 'd:', any (d ))
The output result is as follows:
A: False B: False c: True d: True
Cai junsheng QQ: 9073204 Shenzhen
If python has built-in functions, is there external functions?
Python built-in function built-in function refers to the built-in function in the standard library. These functions do not belong to any class or module and can be called directly. They can be considered an integral part of the python language. Similar to keywords.
Abs ()
Dict ()
Help ()
Min ()
Setattr ()
All ()
Dir ()
Hex ()
Next ()
Slice ()
Any ()
Divmod ()
Id ()
Object ()
Sorted ()
Ascii ()
Enumerate ()
Input ()
Oct ()
Staticmethod ()
Bin ()
Eval ()
Int ()
Open ()
Str ()
Bool ()
Exec ()
Isinstance ()
Ord ()
Sum ()
Bytearray ()
Filter ()
Issubclass ()
Pow ()
Super ()
Bytes ()
Float ()
Iter ()
Print ()
Tuple ()
Callable ()
Format ()
Len ()
Property ()
Type ()
Chr ()
Frozenset ()
List ()
Range ()
Vars ()
Classmethod ()
Getattr ()
Locals ()
Repr ()
Zip ()
Compile ()
Globals ()
Map ()
Reversed ()
_ Import __()
Complex ()
Hasattr ()
Max ()
Round ()
Delattr ()
Hash ()
Memoryview ()
Set ()
Static methods in other modules in the standard library are not built-in functions.
User-Defined extended functions are not built-in.
==================
However, in other languages and environments, built-in functions have different meanings.
Built-in functions do not have a unique specificity in concept. They are compound words. It is best to understand them as "built-in functions"... the rest of the text>
Python beginners start to read the python learning manual. Is there any need to create another python standard library ??
I am also self-taught. This winter vacation started, but I am reading head first python. I think it is better to read one carefully.