Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- accounts = {}
- for t in [line.strip().split(",") for line in open("input9.txt").readlines()]:
- print(t)
- if t[0] == "None":
- if t[1] in accounts:
- accounts[t[1]] += int(t[2])
- else:
- accounts[t[1]] = int(t[2])
- else:
- accounts[t[0]] -= int(t[2])
- if t[1] in accounts:
- accounts[t[1]] += int(t[2])
- else:
- accounts[t[1]] = int(t[2])
- print(len([acc for acc in accounts if accounts[acc] > 10]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement