def f():
lst = ['a', 'b', 'c']
return lst[1:]
why is f().append('a') is None == True even though f().__class__ is <type 'list'> and f() == ['b', 'c']
Because append() returns None and not the list object. Use
l = f()
l.append('a')
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With