Sail E0 Webinar

MCQs

Total Questions : 12 | Page 2 of 2 pages
Question 11. What is the output of the following piece of code?def a(b):    b = b + [5] c = [1, 2, 3, 4]a(c)print(len(c))
  1.    4
  2.    5
  3.    1
  4.    An exception is thrown
 Discuss Question
Answer: Option B. -> 5


Since a list is mutable, any change made in the list in the function is reflected outside the function.


Question 12. What is the output of below program?def f(x, y, z): return x + y + zf(2, 30, 400)
  1.    432
  2.    24000
  3.    430
  4.    No output
 Discuss Question
Answer: Option A. -> 432




Latest Videos

Latest Test Papers