Skip to content

Commit 9fa7a63

Browse files
committed
modified
1 parent 2300756 commit 9fa7a63

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

variable_args.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ def sum(*args):
66
return total
77

88
result = sum(1,8, 2, 3, 15, 4, 5)
9-
print(f"The sum of the numbers is: {result}")
9+
print(f"The sum of the numbers is: {result}")
10+
11+
12+
# **key arguments- or variable-length keyword arguments allow you to pass a variable number of keyword arguments to a function.
13+
def print_info(**kwargs):
14+
for key, value in kwargs.items():
15+
print(f"{key}: {value}")
16+
print_info(name="Adil", age=25, city="New York")

0 commit comments

Comments
 (0)