Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

args in python

# if args is not passed it return message
# "Hey you didn't pass the arguements"

def ech(nums,*args):
    if args:
        return [i ** nums for i in args]  # list comprehension
    else:
        return "Hey you didn't pass args"
    
print(ech(3,4,3,2,1))
 
PREVIOUS NEXT
Tagged: #args #python
ADD COMMENT
Topic
Name
5+1 =