Please can someone explain why the answer is none? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please can someone explain why the answer is none?

fruits = ['apple', 'banana', 'cherry'] cars = ['Ford', 'BMW', 'Volvo'] c=fruits.extend(cars) print(c)

27th Sep 2023, 4:14 PM
Unegbu Chidinma
Unegbu Chidinma - avatar
1 Answer
+ 8
the extend().methods works inplace and does not return anything, hence None
27th Sep 2023, 4:19 PM
Lisa
Lisa - avatar