advanced programming, Quizzes of Programming Languages

............................................

Typology: Quizzes

2022/2023

Uploaded on 01/22/2023

omnia-nabil-gharieb-ghonem
omnia-nabil-gharieb-ghonem 🇪🇬

5 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download advanced programming and more Quizzes Programming Languages in PDF only on Docsity!

Python Questions and Answers - Encapsulation « Prev This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “Encapsulation”. 1. Which of these is not a fundamental features of OOP? a) Encapsulation b) Inheritance c) Instantiation d) Polymorphism View Answer Answer: c Explanation: Instantiation simply refers to creation of an instance of class. It is not a fundamental feature of OOP. 2. Which of the following is the most suitable definition for encapsulation? a) Ability of a class to derive members of another class as a part of its own definition b) Means of bundling instance variables and methods in order to restrict access to certain class members c) Focuses on variables and passing of variables to functions d) Allows for implementation of elegant software that is well designed and easily modified * View Answer Answer: b Explanation: The values assigned by the constructor to the class members is used to create the object. 3. What will be the output of the following Python code? Next »