Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- category = input().strip()
- f = open("operations.csv")
- res = 0.
- for i in f:
- try:
- s = i.split(',')
- if(s[1] == category):
- res += 0.05*float(s[2])
- else:
- res += 0.01*float(s[2])
- except:
- pass # если первая строка - шапка, то тогда в 3-й колонке не число
- res = round(res)
- print(int(res))
Advertisement
Add Comment
Please, Sign In to add comment