File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11def add (* args ):
22 """
3- This shows one use of * in Python: it indicates this function takes in non-key argument and a variable length of arguments
3+ This shows one use of * in Python: it indicates this function takes in non-key argument and a
4+ variable length of arguments
45 :param args:
56 :return:
67 """
@@ -12,7 +13,8 @@ def add(*args):
1213
1314def print_food (** kwargs ):
1415 """
15- Here double asterisk( ** ) is also used as **kwargs, the double asterisks allow passing keyword argument.
16+ Here double asterisk( ** ) is also used as **kwargs, the double asterisks allow passing
17+ keyword argument.
1618 This special symbol is used to pass a keyword arguments and variable-length argument list.
1719
1820 Keyword arguments (or named arguments) are values that, when passed into a function,
@@ -27,4 +29,4 @@ def print_food(**kwargs):
2729 print (f"{ kwargs [items ]} is a { items } " )
2830
2931
30- print (print_food (fruit = 'cherry' , vegetable = 'potato' , boy = 'srikrishna' ))
32+ print (print_food (fruit = 'cherry' , vegetable = 'potato' , boy = 'srikrishna' ))
You can’t perform that action at this time.
0 commit comments