摘要:
dic ={}s = "k:1|k1:2|k2:3|k3:4"lst = s.split("|")for i in lst: lst1 =i.split(":") #k,v = i.split(":") dic(k) = int(v) dic[lst1[0]] = int(lst1[1])print 阅读全文
摘要:
count = 1lst = []lst1 = []while count <=10: name = input("请输入您心仪的女生(您还可以输入%s个):" % (11-count)) lst.append(name) count = count +1print("您当前心仪的女生有:")for 阅读全文
摘要:
number = int(input("请输入一个数字:"))lst = []for i in range(number+1): if i == 7: lst.append("咣") else: lst.append(i)print(lst) 阅读全文
摘要:
lis = []sum = 0while True: content = input("请输入成绩(格式如下张三_44),输入Q退出:") if content == "Q": break else: lis .append(content)for i in lis: s = i.split("_" 阅读全文