Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strings = input().replace(' ', '')
- count = {}
- for string in strings:
- count[string] = count.get(string, 0) + 1
- leather = '\n'.join({f'{letter} -> {num}' for letter, num in count.items()})
- print(leather)
- # input = text
- # correct answer = t -> 2 e -> 1 x -> 1
- # wrong answer 80 percent in case = e -> 1 x -> 1 t -> 2
Advertisement
Add Comment
Please, Sign In to add comment