Iterating through map to print group
for it in groupMap : NEW_LINE INDENT v = groupMap [ it ] NEW_LINE for i in range ( len ( v ) ) : NEW_LINE INDENT print ( str [ v [ i ] ] , end = " ▁ " ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT