|
@@ -1,9 +1,12 @@
|
|
|
-def total(initial=5, *numbers, **keywords):
|
|
|
- count = initial
|
|
|
- for number in numbers:
|
|
|
- count += number
|
|
|
- for key in keywords:
|
|
|
- count += keywords[key]
|
|
|
- return count
|
|
|
+def total(a=5, *numbers, **phonebook):
|
|
|
+ print('a', a)
|
|
|
+
|
|
|
+ #iterate through all the items in tuple
|
|
|
+ for single_item in numbers:
|
|
|
+ print('single_item', single_item)
|
|
|
+
|
|
|
+ #iterate through all the items in dictionary
|
|
|
+ for first_part, second_part in phonebook.items():
|
|
|
+ print(first_part,second_part)
|
|
|
|
|
|
-print(total(10, 1, 2, 3, vegetables=50, fruits=100))
|
|
|
+print(total(10,1,2,3,Jack=1123,John=2231,Inge=1560))
|