I have been challenged to find a way to count how often a letter occurs in a text. I am not allowed to use any modules (import) and the .count function.
Example:
text = 'hello'
How can I check how often each letter occurs in the variable text? How would a beginner do this? Maybe by using a function.
The final result should look like this:
h: 1, e: 1, l: 2, o: 1
Thanks in advance.