Keyword Arguments in Functions in Python


Pass arguments to functions by name.

Source Code

def describe_pet(animal, name):
    print(f"I have a {animal} named {name}.")
describe_pet(name="Harry", animal="hamster")
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments