🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

नीचे दिए गए प्रोग्राम का आउटपुट क्या है?

What is the output of the below program ?

def func(a, b=5, c=10) :
      print('a is', a, 'and b is', b, 'and c is', c)
func(3, 7)
func(25, c = 24)
func(c = 50, a = 100)
A)
B)
C)
D)

Explanation:

Here’s a simple breakdown of the code:

  1. func(3, 7):

    • a = 3, b = 7 (overrides default 5), c = 10 (default).
    • Output: a is 3 and b is 7 and c is 10
  2. func(25, c = 24):

    • a = 25, b = 5 (default), c = 24 (overrides default).
    • Output: a is 25 and b is 5 and c is 24
  3. func(c = 50, a = 100):

    • a = 100, b = 5 (default), c = 50 (overrides default).
    • Output: a is 100 and b is 5 and c is 50

Final Output:

(C) a is 3 and b is 7 and c is 10 a is 25 and b is 5 and c is 24 a is 100 and b is 5 and c is 50

Latest Updates