What is the output of the following code: def my_func(a=[]):
a.append(1)
print(a)

my_func()
my_func()
my_func()
Explanation
my_func has a default argument of type List. List is mutable data type in Python.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Python quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes