Arbitrary Number of Keyword Arguments, **kwargs

Share

Add two asterisks ** before arguments if number of keyword arguments is not known.

def my_optionals(**subject):
print(“His language optional is “ + subject[“lang”])

my_optionals(math = “algebra”, lang = “French”)

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *