Python

Map a string in Python with enumerate

Problem: create a map of the letters and indices in a string.

My first approach was to loop over the string using range(len(s)), and checking if the letter exists in the map before adding it:

Hello world!

UPDATE: At the time this post was published the blog’s name was print(f’{greeting}')

What does this blog name mean?

Newer Posts