📜  如何在python代码示例中将项目附加到列表中

📅  最后修改于: 2022-03-11 14:46:18.795000             🧑  作者: Mango

代码示例4
list = [1, 2, 3]
  print list.append(4)   ## NO, does not work, append() returns None
  ## Correct pattern:
  list.append(4)
  print list  ## [1, 2, 3, 4]