Python程序设计使用序列(第次课)分析.pptVIP

  • 7
  • 0
  • 约1.35万字
  • 约 51页
  • 2016-06-10 发布于湖北
  • 举报
2.3 List (4) Adding elements Method 1: Use the “+” to attach a new list in the tail of a original list a_list = [1] a_list = a_list + [a, 2.0] a_list [1, a, 2.0 ] Method 2: Uses append () method to add a new element to the end of a list; a_list.append(True) a_list [1, a, 2.0, True ] 2.3 列表 (4)增加元素 方法一:使用“+”将一个新列表附加在原列表的尾部; a_list = [1] a_list = a_list + [a, 2.0] a_list [1, a, 2.0] 方法二:使用append( )方法向列表尾部添加一个新元素; a_list.append(True) a_list [1, a, 2.0, True] 2.3 List Method 3: Use the extend () method to add a list at the tail of the original list; a_list.extend([x, 4]) a_list [1,

文档评论(0)

1亿VIP精品文档

相关文档