So I'm relatively new to Python and I'm having a tough time getting my head around kwargs, seems like a simple enough concept but every use of it I see online seem to be different. Am I using it right?
I've a function plot_performance(), which creates a simple scatter plot, and has an optional keyword 'save' which if set to True should save the plot as a PNG.
def plot_performance(list_in, **kwargs):
'''
'''
for key in kwargs:
if (key == 'save') and (kwargs[key] is True):
plt.savefig('plot.png', bbox_inches='tight')
First time posting a question so forgive me if my question is too general or my formatting is off, thanks!