How to use function with multiple optional arguments in Python

1 Answer

0 votes
def f(s, *args):
    print(s)

    for argument in args:
        print(argument)

f('python', 3, 6, 8, 1)





'''
run:

python
3
6
8
1

'''

 



answered Apr 16, 2021 by avibootz

Related questions

...