Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. accounts = {}
  2. for t in [line.strip().split(",") for line in open("input9.txt").readlines()]:
  3. print(t)
  4. if t[0] == "None":
  5. if t[1] in accounts:
  6. accounts[t[1]] += int(t[2])
  7. else:
  8. accounts[t[1]] = int(t[2])
  9. else:
  10. accounts[t[0]] -= int(t[2])
  11. if t[1] in accounts:
  12. accounts[t[1]] += int(t[2])
  13. else:
  14. accounts[t[1]] = int(t[2])
  15.  
  16. print(len([acc for acc in accounts if accounts[acc] > 10]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement