Given a string s containing only the characters (, ), {, }, [ and ], return true if the string is balanced and false otherwise. A string is balanced if every opening bracket has a matching closing bracket of the same type and the pairs are properly nested.
(, ), {, }, [ and ]def is_balanced(s):