Problem concatenating Python list
问题 I am trying to concatenate two lists, one with just one element, by doing this: print([6].append([1,1,0,0,0])) However, Python returns None . What am I doing wrong? 回答1: Use the + operator >>> [6] + [1,1,0,0,0] [6, 1, 1, 0, 0, 0] What you were attempting to do, is append a list onto another list, which would result in >>> [6].append([1,1,0,0,0]) [6, [1,1,0,0,0]] Why you are seeing None returned, is because .append is destructive, modifying the original list, and returning None . It does not