Let us say I have a function like this:
def helloWorld(**args):
for arg in args:
print(args[arg])
To call this function is easy:
helloWorld(myMsg = 'hello, world')
helloWorld(anotherMessages = 'no, no this is hard')
But the hard part is that I want to dynamically name the args from variables coming from a list or somewhere else. And I'd want for myMsg and anotherMessages to be passed from a list (for example, the hard part that I am clueless and I need help with is how to take strings into variables to be inputs of a function).
list_of_variable_names = ['myMsg','anotherMessages']
for name in list_of_variable_names:
helloWorld(name = 'ooops, this is not easy, how do I pass a variable name that is stored as a string in a list? No idea! help!')