NIELIT O Level Exam

<p>What is the output of following?</p><pre><span style="font-size: 14px;">def add(a, b=5):<br></span><span style="font-size: 14px;">&nbsp; &nbsp; return a + b<br></span><span style="font-size: 14px;">print(add(3))</span></pre>

What is the output of following?

def add(a, b=5):
    return a + b
print(add(3))


निम्न code का output क्या होगा?

def add(a, b=5):
    return a + b
print(add(3))

A. 3

B. 5

C. 8

D. Error




Correct Answer is :

C. 8



Explanation

Since b is not supplied, its default value 5 is used: 3 + 5 = 8.



 b की value नहीं दी गई है, इसलिए default value 5 उपयोग होगी: 3 + 5 = 8।

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad