globals 1

This commit is contained in:
Mert Gör ☭ 2023-06-10 12:32:17 +03:00
parent d4bdd11e31
commit 09f92d9179
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
1 changed files with 16 additions and 0 deletions

16
python-temel/globals.py Normal file
View File

@ -0,0 +1,16 @@
x = 10
y = 20
def foo():
print('foo')
g = globals()
val = g['x']
print(val)
val = g['y']
print(val)
val = g['foo']
print(val)