Skip to content

Commit

Permalink
one extra argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Reza4096 committed Dec 2, 2022
1 parent 22a0bea commit 59db40c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kwargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ def myFun(**kwargs):
for key, value in kwargs.items():
print("%s == %s" % (key, value))

myFun(first='Reza', mid='Was', last='Here')
myFun(first='Reza', mid='Was', last='Here')

# to illustrate **kwargs for a variable number of keyword arguments with one extra argument
def myFun2(arg1, **kwargs):
for key, value in kwargs.items():
print("%s == %s" % (key, value))

myFun2("Hi", first='Reza', second='Was', third='Here')

0 comments on commit 59db40c

Please sign in to comment.