v = ('* '*5).split()
print v, len(v), type(v)
print v.append(5)
Output:
['*', '*', '*', '*', '*'] 5 <type 'list'>
None
Why does an attempt to append v cause an output of None? As demonstrated, v is a list type of length 5, but still append does not seem to work.
What can I do to append to v?
My exact case
I have a list of lists:
m = [[1, 2, 3, 4],[5, 6, 7, 8],[1, 2, 3, 4]]
m.append(('* '*5).split().append(" "))
This won't work because I am trying to append None to m.
How can I return this appended list instead of printing it, so that I return the list rather than None?