Python - Why does this code output "None"? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Python - Why does this code output "None"?

a = [1,5,7] b = [2,4,6] c = a.extend(b) print (c)

14th Feb 2020, 5:05 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
2 Answers
14th Feb 2020, 5:09 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
a.extend does not return anything but None. So the output is None.
14th Feb 2020, 8:46 PM
Lothar
Lothar - avatar