随笔分类 - python相关 / list列表
摘要:1. 列表 如果想要表示两个同学 users = "李,李航...". 以后想要表示多个”事物“,可以使用列表。 users = ["李奇","奇",99] 公共功能 len users = ["李奇","航",99] val = len(users) print(val) # 3 索引 users
阅读全文
摘要:users = ["alex",0,True,[11,22,33,"老男孩"],[1,['alex','oldboy'],2,3]] users[0] users[2] users[0][2] users[3] # [11,22,33,"老男孩"] users[3][-1] # "老男孩" user
阅读全文
摘要:list 独有功能:append/insert/pop/remove/clear/ extend 公共功能: len 索引 切片 步长 for循环 删除 更新 强制转换: list("asdfadfasfdadfasfd") v1 = list("asdfadfasfdadfasfd") print
阅读全文