Apologies for the horrible title, but I do not know the proper wording for it, which is part of the problem.
Currently I am making some functions in python with a general structure like this:
def printfunction(parameter1, parameter2, option1=False,option2=False):
print(f"Stuff that always happens+{parameter1}")
if option1 == False and option2 == False:
print(f"Basic Functionality+{parameter2}")
if option1 == True:
print("Option1")
if option2 == True:
print("Option2"
if option1 == True and option2 == True:
print(f"Option 1 and 2+{parameter2}")
So I would like a function that executes it's basic functionality, but if one or multiple of a set of Boolean keywords are set to True, I want it to execute some other functionality (or the original plus some new) and with only 2 "option" keywords the way I did it above works perfectly fine, but if one wants a lot of options like this, the function gets filled with "if option==False/True" statements, making very messy code.
So my question is: Is there a more efficient way of having a function that can execute multiple options? While sharing the initial parameters and some parts of the function.
Or am I just doing this all wrong and should I use a class with different methods?
Thanks in advance for any reply