Answers for "check for python args"

0

args in python

def func(*args):
    x = []          # emplty list
    for i in args:
        i = i * 2
        x.append(i)  
        y = tuple(x) # converting back list into tuple
    return y
        
tpl = (2,3,4,5)        
print(func(*tpl))
Posted by: Guest on June-24-2021
0

args in python

def add(*args):
    total = 0
    for i in args:
        total += i
    
    return total

print(add(5,5,10))
Posted by: Guest on June-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language