Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. count = [0] * 130
  2. f = open('input.txt')
  3. maxCount = 0
  4. for word in f:
  5. for letter in word:
  6. if letter != ' ' and letter != '\n':
  7. count[ord(letter)] += 1
  8. for elem in count:
  9. if elem > maxCount:
  10. maxCount = elem
  11. while maxCount != 0:
  12. for i in range(len(count)):
  13. if count[i] != 0:
  14. if count[i] < maxCount:
  15. print(' ', sep='', end='')
  16. else:
  17. print('#', sep='', end='')
  18. maxCount -= 1
  19. if maxCount != 0:
  20. print()
  21. else:
  22. print()
  23. for j in range(len(count)):
  24. if count[j] != 0:
  25. print(chr(j), sep='', end='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement