MENU
Question -

Write a program to illustrate “variablelength arguments”.



Answer -

#!/usr/bin/python
# Function definition is here
def printinfo(argl,*vartuple):
“This prints a variable passed arguments”
print “Output is:”
print argl for var in vartuple :
print var return;
# Now you can call printinfo function
printinfo(10); printinfo(70,60,50);

When the above code is executed, it produces following result:

Output is:
10
Output is:
70
60
50

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×