I have a python function that contains an if-statement to check something.
def my_func(a, b, c):
if a < b and b < c:
#do complicated stuff
I want to modify the function so that the caller can determine whether or not to perform the if-statement check, by passing in a boolean.
def my_func(a, b, c, perform_check=True):
I’m trying to figure out how to make the conditional only be invoked sometimes, or skipped other times.
I guess something like this is what you need: