Multiple ChoiceIntermediate 30s
Mutable Default Argument
def f(x=[]) is a bug because the default list:
Options
- 1The mutable default cannot be changed afterwards
- 2A mutable default argument raises a TypeError
- 3Is created once and shared across calls
- 4The mutable default is copied fresh each call
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.