# コピペ: 20190416实验002

Plain text

2019-04-16 18:51

` #bduegf #001输出有多个出版社 fi = open("book_list.csv","r") lines = fi.readlines() fl = lines[0] pub = set() for i in range(1,len(lines)):     line = lines[i]     line = line.strip()     line = line.split(',')     line = line[-1]     line = line.split('：')     line = line[-1]     line = line.split('/')     if ('、' in line[1]):         line =line[1]         line = line.split('、')         for x in line:             pub.add(x)     else:         line =line[0]         pub.add(line) print(len(pub)) print(pub) #统计评分>=8.5且评价人数>=2000的书的名字 fl = fl.strip() fl = fl.split(',') pk=pek=nak=0 for i in range(len(fl)):     if fl[i] == '评分' :         pk = i     if fl[i] == '评价人数':         pek = i     if fl[i] == '书名':         nak = i for i in range(1,len(lines)):     line = lines[i]     line = line.strip()     line = line.split(',')    # print(line[pk],line[pek],line[nak])     if float(line[pk]) >= 8.5 and float(line[pek]) >= 2000:         print(line[nak]) fi.close()`