Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

*args **kwargs together in python


>>> def print_everything(*args):
        for count, thing in enumerate(args):
...         print( '{0}. {1}'.format(count, thing))
...
>>> print_everything('apple', 'banana', 'cabbage')
0. apple
1. banana
2. cabbage

Source by w3programmers.org #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
4+6 =