+ 4
why it prints None?
lista = [1,2,3,4,5,6] print(lista.extend([7,8]))
2 ответов
+ 10
print() is supposed to display the return value of the lista.extend() method. But there's nothing to return really, it just extends lista by the list [7, 8]. So the default return value, None, is printed. If you want to see how lista looks now, just print it after extending:
lista.extend([7,8])
print(lista)
Hope that helps 😊
+ 4
It Doesn't return anything, sice get a none🤗