Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dictionary - count characters
import json string1 = input('Enter your string: ').strip() unique_letters = set(string1) letters_occurrences = {} for letter in unique_letters: letters_occurrences[letter] = string1.count(letter) print() # newline # Pretty printing the dictionary print(json.dumps(letters_occurrences, indent=4))
run
|
edit
|
history
|
help
0
GINGERMANZ
kenken1
pico menu
10 25 58
self "keyword"
Lab_III_2_01_12_2020
Юра и заселение
Byear
Python input
Depth First Search - Find path