FresherFresher (0–1 yrs)CodingPythonTCSInfosysWipro
mutable default argument pitfall
Why is `def f(a=[])` dangerous in Python? Show the bug and the correct pattern.
Answers use simple, clear English.
Confidence
#python#pitfalls#defaults
Why is `def f(a=[])` dangerous in Python? Show the bug and the correct pattern.
Answers use simple, clear English.