1 2 3 4 5 6
# test if eval raises SyntaxError try: print(eval("[1,,]")) except SyntaxError: print("SyntaxError")