Consider the statements given below and then choose the correct output from theनीचे दिए गए स्टेटमेंट्स (Statements) पर विचार कीजिए और फिर दिये गये विकल्पों से सही आउटपुट
Consider the statements given below and then choose the correct output from the
given options :
def Change (N) :
N=N+10
print (N , end= '$$ ' )
N=15
Change (N)
print (N)
नीचे दिए गए स्टेटमेंट्स (Statements) पर विचार कीजिए और फिर दिये गये विकल्पों से सही आउटपुट
(Output) चुनिये :
def Change (N) :
N=N+10
print (N , end= '$$ ' )
N=15
Change (N)
print (N)
Show answerHide answer
Correct answer: (A) 25$$1525$$15
Explanation
Inside Change, the local N becomes 25 and is printed followed by "$$". The integer is passed by object reference and is immutable, so the global N stays 15, giving 25$$15.Change के भीतर लोकल N 25 हो जाता है और "$$" के साथ प्रिंट होता है। पूर्णांक object reference से जाता है और अपरिवर्तनीय (immutable) है, इसलिए ग्लोबल N 15 ही रहता है, और आउटपुट 25$$15 है।