If str [ i ] is between A and Z and i is the last occurence in str
elif ( ( str [ i ] >= ' A ' and str [ i ] <= ' Z ' ) and capital [ ord ( str [ i ] ) - 65 ] == i ) : NEW_LINE INDENT occ = ord ( str [ i ] ) - 64 NEW_LINE while ( occ > 0 ) : NEW_LINE INDENT res += str [ i ] NEW_LINE occ -= 1 NEW_LINE DEDENT DEDENT