Question 60Asked in Bihar STET 2024 Paper II Computer Science, 11 Jun 2024, Shift 2 (3:00 PM)

What is the purpose of the "super" keyword in Python?पायथन में "सुपर" कीवर्ड का उद्देश्य क्या है?

पायथन में "सुपर" कीवर्ड का उद्देश्य क्या है?
  1. AIt refers to the superclass of the current classयह वर्तमान वर्ग के सुपरक्लास को संदर्भित करता है
  2. BIt creates a new instance of a classयह एक वर्ग का एक नया उदाहरण बनाता है
  3. CIt handles exceptionsयह अपवादों को संभालता है
  4. DIt defines a new classयह एक नए वर्ग को परिभाषित करता है
Show answerHide answer

Correct answer: (A) It refers to the superclass of the current classयह वर्तमान वर्ग के सुपरक्लास को संदर्भित करता है

Explanation

In Python, super() returns a proxy to the parent (superclass), so you can call its methods, for example super().__init__().Python में super() parent (superclass) का एक proxy लौटाता है, ताकि आप उसके methods बुला सकें, जैसे super().__init__()।

From Bihar STET 2024 Paper II Computer Science PYQ, 11 Jun 2024, Shift 2 (3:00 PM)

This is question 60 of Bihar STET 2024 Paper II Computer Science PYQ, 11 Jun 2024, Shift 2 (3:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.