Advertisement
Sabev

Letter Repetition

Jan 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. word = input()
  2.  
  3. dict_word = {}
  4.  
  5. for letter in word:
  6.     if letter in dict_word:
  7.         dict_word[letter] += 1
  8.     else:
  9.         dict_word[letter] = 1
  10.  
  11. for key, value in dict_word.items():
  12.     print(f"{key} -> {value}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement