Spot the bug in the mutable default

from Python fundamentals
Python 3.14 beginner 4 min 1 issue to find

Find why the second result contains a tag from the first call.

Python
def add_tag(tag, tags=[]):
    tags.append(tag)
    return tags


print(add_tag("new"))
print(add_tag("sale"))
Open in playground
Report an error