Skip to content

Commit f65844f

Browse files
format examples
1 parent 6b42853 commit f65844f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: random_examples.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
def 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

1314
def 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'))

0 commit comments

Comments
 (0)