标签:close http code 增删查改 append closed name 查询 pen
列表的查询与字符串的切边几乎一样,切片去查或者循环去查
如:
l1 = [‘das‘, ‘dfsdf‘,[1,23,],‘asda‘] li = l1[0] print(li) l2 = l1[0:3] print(l2)
l1 = [‘das‘, ‘dfsdf‘,[1,23,],‘asda‘] l1.append(‘sfdg‘) l1.append(324314) print(l1)
l1 = [‘das‘, ‘dfsdf‘,[1,23,],‘asda‘] while 1: username = input(‘>>>‘) if username.upper().strip() == ‘Q‘: break else: l1.append(username) print(l1)
l1 = [‘das‘, ‘dfsdf‘,[1,23,],‘asda‘] l1.extend("udhsfi") l1.extend([1,2,3,4,5,6]) print(l1)
标签:close http code 增删查改 append closed name 查询 pen
原文地址:https://www.cnblogs.com/zly9527/p/11216070.html