Report Bug

Qus

What is the output of following?

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

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

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


A. 3
B. 5
C. 8
D. Error


Solution
C. 8



Explanation
<p><span style="font-size: 14px;">Since b is not supplied, its default value 5 is used: 3 + 5 = 8.</span></p><p><span style="font-size: 14px;"><br></span></p><p><span style="font-size: 14px;"><br></span></p><p><span style="font-size: 14px;">&nbsp;b की value नहीं दी गई है, इसलिए default value 5 उपयोग होगी: 3 + 5 = 8।</span></p>
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