[Type B] Working with Functions – Chapter 3 Sumita Arora

|
Table of Contents

2. Find and write the output of the following Python code:

Python
def Call(P=40, Q=20):
    P = P + Q
    Q = P - Q
    print(P, '@', Q)
    return P

R = 200
S = 100
R = Call(R, S)
print(R, '@', S)
S = Call(S)
print(R, '@', S)

Solution: The output will be:

Python
300 @ 200
300 @ 100
400 @ 300

Leave a Reply

Your email address will not be published. Required fields are marked *