Advertisements
Advertisements
Question
Predict the output of the following code:
def Changer (P, Q=10):
P=P/Q
Q=P%Q
return P
A=200
B=20
A=Changer(A,B)
print(A,B,sep='$')
B=Changer(B)
print(A,B sep='$', end='# # #')
One Line Answer
Solution
10.0$20
10.0$2.0###
shaalaa.com
Arguments and Parameters
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
Observe the following program carefully, and identify the error:
def findValue( vall = 1.1, val2, val3):
final = (val2 + val3)/ vall
print(final)
findvalue() #function call
Differentiate between the following with the help of an example:
Argument and Parameter
Assertion (A): If the arguments in function call statement match the number and order of arguments as defined in the function definition, such arguments are called positional arguments.
Reasoning (R): During a function call, the argument list first contains default argument(s) followed by the positional argument(s).