I want to count how many If/Else statements are in my function.
My code looks like this:
def countdown(type):
if type == 1:
//code
elif type == 2:
//code
else:
print(f"You have reached the end of the script. "
f"The maximum type of countdowns are: {x}")
exit(1)
Where the x is, there should be the number of if queries (If/Else). In this case, there are 3 queries. It should serve that if I create another if/else query within this function, I don't have to change the warning at the bottom of the script.
Is that even possible?
I'm using Python 3.10