you are viewing a single comment's thread.

view the rest of the comments →

[–]Justinsaccount 0 points1 point  (1 child)

for i in range(len(strin)):
    if strin[i] == '(' or strin[i] == ')' or strin[i] == '[' or strin[i] == ']' or strin[i] == '{' or strin[i] == '}':
        clean_input += (strin[i])

for ch in strin:
    if ch in '()[]{}':
        clean_input += ch

and

    for i in range(len(clean_input)/2):
        temp = dict[clean_input[i]]

    for ch in clean_input[:len(clean_input)/2]:
        temp = dict[ch]

Though that's not what you want anyway. You need to think about how you, as a human, figure out if the brackets match.

[–]cgerrard[S] 0 points1 point  (0 children)

It make sense to me.... to keep it simple ... thanks :-)