Skip to content
CodeKruPro

A list as a default argument

QuizEasy-MediumPython only

What does this print?

def add_item(item, items=[]):
    items.append(item)
    return items

print(add_item("a"), add_item("b"))
Choose one answer.

to answer and keep your progress. Reading is free for everyone.