Balanced brackets
Write is_balanced(s) that returns True if every opening bracket ( [ { is closed by the matching type in the correct order. Ignore any other characters.
Examples
is_balanced("{[()]}") → True
is_balanced("([)]") → FalseExercise
4 checksBalanced brackets
def is_balanced(s):
...
print(is_balanced("{[()]}"), is_balanced("([)]"))
Press Run to try your code, then Check answer to grade it.