全局变量,局部变量 ,内置函数,全集

# print(globals())#全局变量
# print(locals())#局部变量
arr = dir(__builtins__)#这个可以看内置的方法哦
for i in range(len(arr)):
    print(f"{i}---{arr[i]}")

下面的是具体有哪些内置方法:等我有空了,把你们都搞一下,记得回来补充啊

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

 

posted @ 2021-06-30 15:52    阅读(44)  评论(0编辑  收藏  举报