Why doesn’t this code print [7] ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why doesn’t this code print [7] ?

empty_list = [] x = empty_list.append(7) print(x)

21st Aug 2019, 12:34 AM
Evan
1 Answer
+ 1
append() function will add the passed value to the end of list.
21st Aug 2019, 2:33 AM
Kuri
Kuri - avatar