Advertisement
danchaofan

Euler #79

Dec 9th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. file, first, second, third = [], "", "", ""
  2. for a in list(open("password.txt")):
  3.     file.append(a.rstrip())
  4. for b in file:
  5.     index = 0
  6.     for c in b:
  7.         if index == 0:
  8.             first += c
  9.         if index == 1:
  10.             second += c
  11.         if index == 2:
  12.             third += c
  13.         index += 1
  14.  
  15. print("First counts:")
  16. for d in range(10):
  17.     print(d, first.count(str(d)))
  18. print("Second counts:")
  19. for e in range(10):
  20.     print(e, second.count(str(e)))
  21. print("Third counts:")
  22. for f in range(10):
  23.     print(f, third.count(str(f)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement