Consider the given Python program.
def append_to_lst(val, lst=[]):
lst.append(val)
return lst
print(append_to_lst(1))
print(append_to_lst(2))
print(append_to_lst(3, []))Which of the following is the correct output of this program?
- (A)
[1]
[2]
[3] - (B)
[1]
[1, 2]
[3] - (C)
[1]
[2]
[1, 2, 3] - (D)
[1]
[1, 2]
[1, 3]
