خروجی این تکه کد چیه؟ def add_item(item, lst=[]): lst.append(item)…

🔆 خروجی این تکه کد چیه؟

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

print(add_item(1))
print(add_item(2))
print(add_item(3, [9, 9]))
print(add_item(4))

🔹گزینه‌ها:

الف) [1], [2], [9, 9, 3], [4]
ب) [1], [1, 2], [9, 9, 3], [1, 2, 4]
ج) [1], [2], [3], [4]

🐍 @python_rd
۱۸ مهر ۱۴۰۵ ۴۵۹ ۲ ۱