You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
184 B
14 lines
184 B
4 years ago
|
# test builtin locals()
|
||
|
|
||
|
x = 123
|
||
|
print(locals()['x'])
|
||
|
|
||
|
class A:
|
||
|
y = 1
|
||
|
def f(self):
|
||
|
pass
|
||
|
|
||
|
print('x' in locals())
|
||
|
print(locals()['y'])
|
||
|
print('f' in locals())
|