Python Quiz: Why did the first item stick around? What does the…

🐍 Python Quiz: Why did the first item stick around?
What does the second print() show?

def add_task(task, tasks=[]):
tasks.append(task)
return tasks

print(add_task("Study")) # ['Study']
print(add_task("Design")) # ?
Python documentation
4. More Control Flow Tools
As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. if Statements: Perhaps the most well-known statement type is the if statement. For exa...
👏2🔥1
December 2, 2026 159 1