function_varargs.py 384 B

12345678910111213
  1. def total(a=5, *numbers, **phonebook):
  2. print('a', a)
  3. #iterate through all the items in tuple
  4. for single_item in numbers:
  5. print('single_item', single_item)
  6. #iterate through all items in dictionary
  7. for first_part, second_part in phonebook.items():
  8. print(first_part,second_part)
  9. print(total(10,1,2,3,Jack=1123,John=2231,Inge=1560))