本帖最后由 chinajz 于 2023-2-5 17:55 编辑
所有的内置函数:n=0
for i in dir(__builtins__): n +=1;print(f'{n}',i,end=" | ")
Python 3.10.9运行结果,156个:1 ArithmeticError | 2 AssertionError | 3 AttributeError | 4 BaseException | 5 BlockingIOError | 6 BrokenPipeError | 7 BufferError | 8 BytesWarning | 9 ChildProcessError | 10 ConnectionAbortedError | 11 ConnectionError | 12 ConnectionRefusedError | 13 ConnectionResetError | 14 DeprecationWarning | 15 EOFError | 16 Ellipsis | 17 EncodingWarning | 18 EnvironmentError | 19 Exception | 20 False | 21 FileExistsError | 22 FileNotFoundError | 23 FloatingPointError | 24 FutureWarning | 25 GeneratorExit | 26 IOError | 27 ImportError | 28 ImportWarning | 29 IndentationError | 30 IndexError | 31 InterruptedError | 32 IsADirectoryError | 33 KeyError | 34 KeyboardInterrupt | 35 LookupError | 36 MemoryError | 37 ModuleNotFoundError | 38 NameError | 39 None | 40 NotADirectoryError | 41 NotImplemented | 42 NotImplementedError | 43 OSError | 44 OverflowError | 45 PendingDeprecationWarning | 46 PermissionError | 47 ProcessLookupError | 48 RecursionError | 49 ReferenceError | 50 ResourceWarning | 51 RuntimeError | 52 RuntimeWarning | 53 StopAsyncIteration | 54 StopIteration | 55 SyntaxError | 56 SyntaxWarning | 57 SystemError | 58 SystemExit | 59 TabError | 60 TimeoutError | 61 True | 62 TypeError | 63 UnboundLocalError | 64 UnicodeDecodeError | 65 UnicodeEncodeError | 66 UnicodeError | 67 UnicodeTranslateError | 68 UnicodeWarning | 69 UserWarning | 70 ValueError | 71 Warning | 72 WindowsError | 73 ZeroDivisionError | 74 __build_class__ | 75 __debug__ | 76 __doc__ | 77 __import__ | 78 __loader__ | 79 __name__ | 80 __package__ | 81 __spec__ | 82 abs | 83 aiter | 84 all | 85 anext | 86 any | 87 ascii | 88 bin | 89 bool | 90 breakpoint | 91 bytearray | 92 bytes | 93 callable | 94 chr | 95 classmethod | 96 compile | 97 complex | 98 copyright | 99 credits | 100 delattr | 101 dict | 102 dir | 103 divmod | 104 enumerate | 105 eval | 106 exec | 107 exit | 108 filter | 109 float | 110 format | 111 frozenset | 112 getattr | 113 globals | 114 hasattr | 115 hash | 116 help | 117 hex | 118 id | 119 input | 120 int | 121 isinstance | 122 issubclass | 123 iter | 124 len | 125 license | 126 list | 127 locals | 128 map | 129 max | 130 memoryview | 131 min | 132 next | 133 object | 134 oct | 135 open | 136 ord | 137 pow | 138 print | 139 property | 140 quit | 141 range | 142 repr | 143 reversed | 144 round | 145 set | 146 setattr | 147 slice | 148 sorted | 149 staticmethod | 150 str | 151 sum | 152 super | 153 tuple | 154 type | 155 vars | 156 zip |
小写的内置函数:n=0
for i in dir(__builtins__):
if i.islower() and i.strip('_') == i:
n +=1;print(f'{n}',i,end=" | ")
运行结果:1 abs | 2 aiter | 3 all | 4 anext | 5 any | 6 ascii | 7 bin | 8 bool | 9 breakpoint | 10 bytearray | 11 bytes | 12 callable | 13 chr | 14 classmethod | 15 compile | 16 complex | 17 copyright | 18 credits | 19 delattr | 20 dict | 21 dir | 22 divmod | 23 enumerate | 24 eval | 25 exec | 26 exit | 27 filter | 28 float | 29 format | 30 frozenset | 31 getattr | 32 globals | 33 hasattr | 34 hash | 35 help | 36 hex | 37 id | 38 input | 39 int | 40 isinstance | 41 issubclass | 42 iter | 43 len | 44 license | 45 list | 46 locals | 47 map | 48 max | 49 memoryview | 50 min | 51 next | 52 object | 53 oct | 54 open | 55 ord | 56 pow | 57 print | 58 property | 59 quit | 60 range | 61 repr | 62 reversed | 63 round | 64 set | 65 setattr | 66 slice | 67 sorted | 68 staticmethod | 69 str | 70 sum | 71 super | 72 tuple | 73 type | 74 vars | 75 zip |
|