So I'm really not sure how to word this question, or I'm sure I could just google it.
I have a function such as:
def example(parameter1 = "", parameter2 = "", parameter3 =""):
print(parameter1)
print(parameter2)
print(parameter3)
And I want to be able to, say, call it 3 times and pass in only one parameter at once such as:
example(parameter1 = "Hello")
example(parameter2 = "Stack")
example(parameter3 = "Overflow")
But in my real code I need to generalize this heavily and have a LOT more parameters, so I want to be able to do something along the lines of:
paramnames = ['parameter1', 'parameter2', 'parameter3']
parameters = ['Hello', 'Stack', 'Overflow']
for i in range(3):
example(paramnames[i] = parameters[i])
Is there any way in python to accomplish this?