+ 1
What should be the output of given append op.
list=[] list. append([].append(2)) i thought output will came as [[2]] but it gives [None] ??
3 ответов
+ 1
list=[]
list.append([])
list[0].append(2)
try this, the append function doesn't return anything so you have to use it like this
+ 1
the append function returns none so what you're doing is list.append(none)
+ 1
thanks!!