Find and write the output of the following Python code:

def Change(P ,Q=30):

P=P+Q

Q=P-Q

print( P,"#",Q)

return (P)

R=150

S=100

R=Change(R,S)

print(R,"#",S)

S=Change(S)

 

Answer:

Question1-Find and write the output - Teachoo.jpg

The output of the given code is:

250 # 150

250 # 100

130 # 100

Remove Ads
Teachoo · Class 12 Explore Class 12
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.