- 1
Intermediate Python 10.0 Given a string as input, you need to output how many times each letter appears in the string.
text = input() dict = {} for char in text: if char in dict: dict[char] += 1 else: dict[char] = 1 print(dict)
1 ответ
text = input() dict = {} for char in text: if char in dict: dict[char] += 1 else: dict[char] = 1 print(dict)