- 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)

23rd Sep 2021, 8:56 AM
Nikam Anant Shivaji
Nikam Anant Shivaji - avatar
1 Antwort