So I'm studying Python and learning def
and what it dose but when i try to run the following code
def test1():
a = [" " , " " , " "]
return a
test1()
print(a)
the error pop up saying that a
is not defined.
a
is defined only in the scope of test1
. You have to do a = test1()
to store the value in a.