Answers for "python get args in function"

0

python get args

import sys

print(sys.argv)
Posted by: Guest on February-23-2021
0

args in python

def wrap(*args):
        lis = list(args)  # it is important to convert args into list before looping, args take tuple as a argument 
        for i in range(len(lis)):
            lis[i] = lis[i] * 2
        args = tuple(lis)
        return args
print(wrap(2,3,4,5,6))
Posted by: Guest on June-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language