python get args
import sys
print(sys.argv)
python get args
import sys
print(sys.argv)
args in python
# normal parameters with *args
def mul(a,b,*args): # a,b are normal paremeters
multiply = 1
for i in args:
multiply *= i
return multiply
print(mul(3,5,6,7,8)) # 3 and 5 are being passed as a argument but 6,7,8 are args
args in python
def display(a,b,c):
print("arg1:", a)
print("arg2:", b)
print("arg3:", c)
lst = [2,3]
display(1,*lst)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us