0
Arbitrary argument*////functions
unable to utilize the arbitrary argument showing tuple and int error https://code.sololearn.com/cD0MiSYYPI27/?ref=app
4 Answers
0
as input is dynamic if I want to add 4 parameters but give code for 3 parameters we use arbitrary argument! so now u got my question
0
hi,
sorry for that.
took an hour.
try this.
code:-
def add(*args):
z = 0
for num in args:
z += num
print(z)
add(1,1,1,1)
this is compilation online:-
https://ide.geeksforgeeks.org/xPghRHo6u6
#python #codding
0
don't worry I got in the msrg itself a+sum(b)
- 1
hi,
do not put pointers in arguments ( *parameters) ,
it will not work.
correct code:-
def add(a, b,c):
print('a',a)
print('b',b)
print('c',c)
if b>6:
b=0
return (a+b)
print (add(6,7,8))
#python #codding