python-CSD-kursu/python-temel/locals.2.py
2023-06-10 12:59:26 +03:00

11 lines
218 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

def foo():
a = 10
d = locals()
d['b'] = 100
print(b)
foo()
# Burada biz b değişkenini foo fonksiyonunun yerel değişken listesine ekleyemedik. Bu nedenle print çağrısında error oluşacaktır.