假设你需要给列表添加一个元素的话,可以用list的append方法,append()方法接受的参数可以是任意的数据,比如,string,list,tuple等

a = '111'

b = [1,2,3]

c = (1,2,3)

cinfo = [44,55,66]

cinfo.append(a)
cinfo.append(b)
cinfo.append(c)
print cinfo

结果是:[44, 55, 66, '111', [1, 2, 3], (1, 2, 3)]

相关文章:

  • 2021-12-01
  • 2021-09-14
  • 2021-12-12
  • 2021-07-29
  • 2021-09-20
  • 2021-04-07
  • 2021-11-20
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2021-09-29
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
  • 2021-10-04
相关资源
相似解决方案