摘要: #coding=utf-8 book_list=[] #图书馆所有书 unborrowed_book=[] #可借阅的书 borrowed_book=[] #已经借出去的书 def add(): #添加书 global book_list global unborrowed_book book_na 阅读全文
posted @ 2017-12-17 22:12 reyinever 阅读(2424) 评论(0) 推荐(0) 编辑
摘要: 1.方法一: >>> a=[1,1,2,2,3,3] >>> b=[] >>> for i in a: ... if i not in b: ... b.append(i) ... >>> b [1, 2, 3] >>> 2.方法二: >>> a=[1,1,2,2,3,3] >>> for i in 阅读全文
posted @ 2017-12-17 22:10 reyinever 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1.list(列表): list是处理一组有序项目的数据结构 list(列表)是python中使用最频繁的数据类型 list中什么类型的数据都可以存放(如:类、自己、函数......); list(列表)可以完成大多数数据集合类的数据结构实现,它支持字符、数字、字符串甚至还可以嵌套列表、元组、字典等 阅读全文
posted @ 2017-12-17 21:54 reyinever 阅读(348) 评论(0) 推荐(0) 编辑