def valid_char(): while True: char="("")""[""]""{""}""()[]{}" try: int_char=char(input("Enter your string:") except ValueError: print("Error, please input a valid parenthesis:") elif: print("This is your string", int_char) break valid_char()
except ValueError: ^ SyntaxError: invalid syntax
int_char=char(input("Enter your string:")
int_char=char(input("Enter your string:"))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)