Junior — Senior
What is the result output by the program when an element is added to the list?
livecode
Task condition
What output will appear in the console after executing the following code? The function takes an element and adds it to a list, which has a default value.
def add_item_to_list(item, my_list=[]):
my_list.append(item)
return my_list
print(add_item_to_list(1))