Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inp = input()
- yearsales = {}
- with open("wands.csv", "r", encode="utf") as infile:
- for n, line in enumerate(infile, 1):
- line = line.rstrip('\n')
- tempsplit = line.split(';')
- if tempsplit[0] == inp:
- if (yearsales.get(year)):
- yearsales[year] += 1
- else:
- yearsales[year] = 1
- maxk, maxv = 0
- for k, v in yearsales.items():
- if v > maxv:
- maxv = v
- maxk = k
- print(maxk)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement