I have a function that can take either 1 string or 4 strings:
def my_function(a, b, c, d, e):
I want the user to either pass in a
, or to pass in b, c, d and e
. I know that I can make them all default to None
, but then I need to have logic in my code that ensures that we either get only a
, or that we get values for all of b
, c
, d
and e
.
Is there a better way to structure this? I really don't want to have two different methods, but that is also a possibility.