python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Are there caveats of using mutable types as default parameters in functions in Python?
I have recently read about mutable default parameters in Python.
For some reason, I came up with an idea of using it like this:
data = [3, 4, 1, 8, 5, 9, 2, 6, 7]
def get_min(checked=[]):
global...
Oleksandr Novik
Votes: 0
Answers: 1