chenyiyun 发表于 2019-2-23 20:41:31

python有多少个BIF(内置函数)啊?

请各位大佬们帮助!

>>> dir(python)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
    dir(python)
NameError: name 'python' is not defined


注:千万不要这样做,会报错

请帮助...

ba21 发表于 2019-2-23 22:22:40

dir(__builtins__)

_谪仙 发表于 2019-2-23 22:27:05

http://www.runoob.com/python3/python3-built-in-functions.html

chenyiyun 发表于 2019-2-24 14:01:31

ba21 发表于 2019-2-23 22:22
dir(__builtins__)

>>>
dir(__builtins__)
['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'ModuleNotFoundError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'WindowsError', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']

chenyiyun 发表于 2019-2-24 14:02:07

chenyiyun 发表于 2019-2-24 14:01
>>>
dir(__builtins__)
['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',...

多谢大佬

17620892658 发表于 2023-8-30 15:15:15

ba21 发表于 2019-2-23 22:22
dir(__builtins__)

打印出来一个个数是个费劲的事情
页: [1]
查看完整版本: python有多少个BIF(内置函数)啊?