Computer Science - Class 12
Chapter 14 - Functions in python

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

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo