How to set optional parameter of function to a list?
def fun1(text, where = my_list):
#my_list.append(text)
where.append(text)
print(where)
#return where
my_list = []
fun1('hi')
print(my_list)
# currently
#['hi']
#[]
# expected
#['hi']
#['hi']
I am getting an undefined name my_list error in Spyder.