def my_grocery_list(**kwargs):
print(kwargs)
print(type(kwargs))
for item in kwargs:
print(f"{kwargs[item]} {item}")
my_grocery_list(toothpaste='Colgate',toothbrush='Colgate',
num_of_toothbrush=2)
Output:
{'toothpaste': 'Colgate', 'toothbrush': 'Colgate','num_of_toothbrush': 2}<class 'dict'> Colgate toothpaste Colgate toothbrush 2 num_of_toothbrush
No comments:
Post a Comment