01 2018 档案
集合及其运算
摘要:list_1=[1,4,5,7,3,6,7,9] list_1=set(list_1)#将列表转化成集合操作,集合最好的应用是去重 list_2=set([2,6,0,66,22,8]) print(list_1,list_2) #取两个集合交叉的内容,交集 print(list_1.intersection(list_2)) #取两个集合的并集 print(list_1.union(list_... 阅读全文
posted @ 2018-01-21 21:01 zechome 阅读(106) 评论(0) 推荐(0)
三级菜单-字典
摘要:date={ '江苏':{ '徐州':{ "邳州":["开发区","新城区"], "新沂":["铁富","官湖"] }, '南京':{ "玄武区":["新东方","夫子庙"], "秦淮区":["雨花台","秦淮河"] } ... 阅读全文
posted @ 2018-01-17 21:43 zechome 阅读(71) 评论(0) 推荐(0)
购物车
摘要:自己写的 import sys goods=[[1,"milk",5],[2,"bike",800],[3,"iphone",5800]] bought=[] salary=int(input("input your salary:")) for i in goods: print(i) while 1: id=input("input the id of goods whic... 阅读全文
posted @ 2018-01-14 18:54 zechome 阅读(102) 评论(0) 推荐(0)
python-登录
摘要:import sys input_name=input("input your name:") f1=open("F:/测试资料/pythonlearn/day1/luckname.txt","r") lines = f1.readlines() for line in lines: user= line.strip('\n') if input_name==user: ... 阅读全文
posted @ 2018-01-08 22:14 zechome 阅读(130) 评论(0) 推荐(0)