6
Last seen 7 years ago
Member for 11 years, 7 months, 13 days
Difficulty Normal
I did this same thing at first. A couple of points, you can combine your if statement into a return statement.
return len(blist) <= 0
You can use a dictionary for your if statement and get one if instead of 3.
BRACKETS = ["(":")", "[":"]", "{":"}"]
if len(blist)==0 and BRACKETS[char] == char
More