Wednesday, 17 May 2017

Strange? Appending to a list directly gives None, but not when appending indirectly

a = ['no', 'nei']
a.append('hei')
print(a)

Works fine and returns  ['no', 'nei', 'hei]

But:
print(['no', 'nei'].append('hei'))

Returns None

This is probably logical, but I did not expect it!