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
Ваня и забор
inerse_matrix_gauss_jordan
Removing adjacent duplicates from string
Ej2_PYTHON_203700377.
Nitin phate
НОД по Евклиду на ПИТОНЕ
PrimeNumbers
Basic_if_else.py
python_study_note_for loop@nested loop
Lesso#6 updated