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

निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

What will be the output of the following Python code ?

def func(a, b=5, c=10):
       print(‘a is’, a, ‘and b is’, b, ‘and c is’, c)
func(13, 17)
func(a=2, c=4)
func(5,7,9)
A)
B)
C)
D)

Explanation:

Here's the breakdown:

  1. First call: func(13, 17)

    • a = 13, b = 17, c = 10 (default).
      Output: a is 13 and b is 17 and c is 10.
  2. Second call: func(a=2, c=4)

    • a = 2, b = 5 (default), c = 4.
      Output: a is 2 and b is 5 and c is 4.
  3. Third call: func(5, 7, 9)

    • a = 5, b = 7, c = 9.
      Output: a is 5 and b is 7 and c is 9.

Final output:

a is 13 and b is 17 and c is 10
a is 2 and b is 5 and c is 4
a is 5 and b is 7 and c is 9

Answer: (C)

Latest Updates