I have the following code and expecting flake8 not to raise any error as the variable name _ex starts with a underscore. But flake8 still gives me F841 local variable '_ex' is assigned to but never used
error. How can I get rid of the error?
try:
1/0
except ZeroDivisionError as _ex:
print("zero division error")
I just dropped the variable and it worked
try:
1/0
except ZeroDivisionError:
print("zero division error")