How to pass tuple as argument to a function in Python

2 Answers

0 votes
def print_tuple(*t):
    for item in t:
        print(item)

print_tuple("python", "java", "php", "c++", "c")

'''
run:

python
java
php
c++
c

'''

 



answered Oct 29, 2018 by avibootz
0 votes
def print_tuple(*t):
    for item in t:
        print(item)

print_tuple(4, 6, 1, 9, 23)

'''
run:

4
6
1
9
23

'''

 



answered Oct 29, 2018 by avibootz
...