i need to know if the variable is defined or not in python without making error because i am working on a project has a lot of variables and i need to know if the variable is defined to know if the operation has been do or not
is there method or way to know if the variable defind or not without makeing error ?
now i use this code below but it makes error to know if the variable defined or not :
try:
variable
print("this variable is defined")
except:
print("this variable is not defined")