Easy
95 views
Why is a mutable default argument dangerous, and how can you fix it?
Default argument expressions are evaluated when the function is defined, not each time it is called. A list used as a default can therefore retain items between calls that omit the argument. Use None ...
Verified Model Solution
View Full Answer