摘要: lst = []# sum = 0with open("a",mode="r",encoding="utf-8") as f: for line in f: dic = {} s = line.strip().split(" ") dic["name"] = s[0] dic["price"] = 阅读全文
posted @ 2019-06-22 15:39 冰灬荷 阅读(152) 评论(0) 推荐(0) 编辑
摘要: lst = [6,5,7,1,2,6,4,5] 阅读全文
posted @ 2019-06-14 10:27 冰灬荷 阅读(287) 评论(0) 推荐(0) 编辑
摘要: lst = []while len(lst)< 7: from random import randint i = randint(1, 36) if i not in lst: lst.append(i)print(lst) from random import randints = set() 阅读全文
posted @ 2019-06-10 13:46 冰灬荷 阅读(139) 评论(0) 推荐(0) 编辑
摘要: while 1 : number = input("请输入一个三位数:") sum = 0 if number.isdigit(): for i in number: sum = sum + int(i)**3 if sum == int(number): print("这是一个水仙花数") els 阅读全文
posted @ 2019-06-08 11:10 冰灬荷 阅读(238) 评论(0) 推荐(0) 编辑
摘要: zhubo = {"卢本伟":12200,"冯提莫":189999,"金老板":99999,"吴老板":25000000,"alex":126}sum = 0lst = []for i in zhubo.values(): sum = sum + iaverage = sum/len(zhubo)p 阅读全文
posted @ 2019-06-07 16:40 冰灬荷 阅读(148) 评论(0) 推荐(0) 编辑
摘要: cars = ["鲁A32444","鲁B12333","京B8989M","黑C49678","黑C46555","沪B25041"]locals = {"沪":"上海","黑":"黑龙江","鲁":"山东","鄂":"湖北","湖":"湖南"}lst = []dic ={}f 阅读全文
posted @ 2019-06-05 07:44 冰灬荷 阅读(229) 评论(0) 推荐(0) 编辑
摘要: dic = { "-":"fu", "0":"ling", "1":"yi", "2":"er", "3":"san", "4":"si", "5":"wu", "6":"liu", "7":"qi", "8":&quo 阅读全文
posted @ 2019-06-04 16:17 冰灬荷 阅读(143) 评论(0) 推荐(0) 编辑
摘要: lst = ["钢铁侠","解救吾先生","美国往事","西西里的美丽传说"]dic = {}for i in lst: score = input("请为 %s打分:" % i) dic[i] = scoreprint(dic) 阅读全文
posted @ 2019-06-04 16:10 冰灬荷 阅读(104) 评论(0) 推荐(0) 编辑
摘要: goods = [{"name":"电脑","price":1999}, {"name":"鼠标","price":10}, {"name":"游艇","price":20}, {"name":"美女","price":998}]for i in goods: k,v = i.values() pr 阅读全文
posted @ 2019-05-29 15:27 冰灬荷 阅读(928) 评论(0) 推荐(0) 编辑
摘要: dic = {}lst1 = []lst2 = []li = [11,22,33,44,55,66,77,88,99,90]for i in li: if i > 60: lst1.append(i) elif i < 60 : lst2.append(i)dic["k1"] = lst1dic[" 阅读全文
posted @ 2019-05-29 14:52 冰灬荷 阅读(122) 评论(0) 推荐(0) 编辑