红色部分为功能实现部分
---------------------
郭靖|秘籍|还有|0-10|300
郭靖|秘籍|还有|10-20|100
郭靖|秘籍|还有|0-10|400
郭靖|秘籍|还有|0-10|1000
郭靖|秘籍|还有|10-20|300
郭靖|秘籍|还有|0-10|483
郭靖|秘籍|还有|20-30|9999
----------------------------样例数据
#!/usr/bin/env python
# coding=utf-8
file_name = "./xyz"
res1 = {}
with open(file_name) as fd:
for line in fd:
line = line.strip("\n")
if not line:
continue
if line.startswith("Monthly2"):
items = line.split("|")
try:
name = items[3]
count = int(items[4])
except:
&n