Q: What is output for list1,2,3 ?
1 | def extendList(val, list=[]): |
Wrong answer : list1 = [10], list2 = [123], list3 = [‘a’]
Correct answer :
How could we change to it ?
1 | def extendList(val, list=None): |
Q: What is output for list1,2,3 ?
1 | def extendList(val, list=[]): |
Wrong answer : list1 = [10], list2 = [123], list3 = [‘a’]
Correct answer :
How could we change to it ?
1 | def extendList(val, list=None): |