def is_paired (input_string): for char input_string: if char in opening: stack.append(char)