0
Why the result of this is None?
fd =[] fd1 = fd.extend(["John", "M", 18]) print(fd1)
3 odpowiedzi
+ 8
`extend` method works directly on the calling object (`list` object fd) and doesn't return a new (modified) `list` object . In Python, when a function/method doesn't explicitly return anything, a None object is returned.
The same goes for `append` method.
(Edited)
+ 3
Yes, you got that right 👍
+ 2
Ipang i see, that means I dont need fd1, just print fd after use the function, right?