Sobes.tech
Intern — Senior

Default argument behavior features in Python

livecode

Task condition

What will be the output of the program if the following code is executed?


def extend_list(val, lst=[]):
    lst.append(val)
    return lst

print(extend_list(10))
print(extend_list(123, []))
print(extend_list('a'))