Created
September 7, 2021 07:48
-
-
Save JimDennis/38a401cd73dfffc85b3c9f425d33fa55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dic = {} | |
for idx, char in enumerate (string): | |
if char! =' ': | |
if char not in dic: | |
dic [char] = [idx] | |
else: | |
dic [char].append(idx) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compare this to: