As you can see in the code, i have a function that needs a tuple (*args) and now i am handling errors about that. It's mission is not necessary now but i have a problem with syntax error. When i write 1a6 in the parenthesis, i expect the customized error message. When i run it, normally i see an error message but it's not mine.
def member_finder_outer(*args):
return args
try:
print(member_finder_outer(1, 12, 13, 14, 15, 1a6, 17, 18, 19, 20, 21))
except:
print("I want here.")
File "d:/Burak/Yazılım/Python/Dersler/17-/Binary Search/binary_search.py", line 55
print(member_finder_outer(1, 12, 13, 14, 15, 1a6, 17, 18, 19, 20, 21)
^
SyntaxError: invalid syntax
I have tried these:
except SyntaxError:
print("I want here.")
except Exception:
print("I want here.")
except SyntaxError as e:
print("I want here.",e)
But it still writes it's own error message.