LearnPy Hub
← Dictionaries problems
Medium

Letter Positions

Read a word and print, for each distinct letter in alphabetical order, the list of positions where it appears: a [1, 3, 5].

Input

One word.

Output

One line per letter.

Sample 1

Input
banana
Output
a [1, 3, 5]
b [0]
n [2, 4]

Sample 2

Input
abc
Output
a [0]
b [1]
c [2]
solution.py
Output appears here
Letter Positions · Python practice problem · LearnPy Hub