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>
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad