Unit 5: Object-Oriented
Programming in Python
Total points 25/25
Stay Tuned for Daily Quizzes on All 6th Semester Computer Group Subjects like
PHP, Python, MAD, and other
Online Quiz to help you in preparing for Online Exams, It covers Multiple Choice
Questions (MCQs) for 25 Marks
imp Links:
All Theory tutorials: https://bit.ly/335XFKi
contact us on [email protected]
25 Marks
1. Which of the following is correct with respect to the OOP 1/1
concept in Python? *
A. Objects are real world entities while classes are not real.
B. Classes are real world entities while objects are not real.
C. Both objects and classes are real world entities.
D. Both object and classes are not real.
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 1/10
2. How many objects and reference variables are there for the 1/1
given Python code? *
A. 2 and 1
B. 3 and 3
C. 3 and 1
D. 3 and 2
Feedback
Explanation: obj is the reference variable here and an object will be created
each time A() is called.So there will be 3 objects created.
3. In python, what is the method inside a class? * 1/1
A. attribute
B. object
C. argument
D. function
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 2/10
4. Which of these is not a fundamental feature of OOP? * 1/1
a) Encapsulation
b) Inheritance
c) Instantiation
d) Polymorphism
5. Private members of a class cannot be accessed. * 1/1
True
False
6. _____ represents an entity in the real world with its identity 1/1
and behavior. *
a) A method
b) An object
c) A class
d) An operator
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 3/10
7. _____ is used to create an object. * 1/1
a) class
b) constructor
c) User-defined functions
d) In-built functions
8. What is Instantiation in terms of OOP terminology? * 1/1
a) Deleting an instance of class
b) Modifying an instance of class
c) Copying an instance of class
d) Creating an instance of class
9. The __init__() function is a _________ * 1/1
a) constructor
b) destructor
c) method
d) initilized method
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 4/10
10. Is that true __init__() function automatically called when an 1/1
object is created? *
True
False
11. Constructor overloading is allowed in python. * 1/1
True
False
12. __del__() is _________ * 1/1
a) method
b) delete method
c) destructor
d) none of the above
13. Is this code is valid in python or not * 1/1
Yes
No
Maybe
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 5/10
14. How to declare a private variable in python, Using * 1/1
a) private keyword
b) __ (double underscore)
c) _ (single underscore)
d) none of the above
15. The class from which the child class inherits is called 1/1
________ *
i) Child class
ii) Parent class
iii) Super class
iv) Base class
v) Both ii and iv
16. Does python have an "abstract" keyword * 1/1
Yes
No
Maybe
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 6/10
17. Which of the following is/are contents of polymorphism. * 1/1
a) method overloading
c) method overriding
c) both above
d) none of the above
18. Which keyword is used to access members of the base 1/1
class? *
a) self
b) pass
c) super
d) assert
19. __str__() function is reffers to * 1/1
a) string representation
b) object representation
c) both a and b
d) none of the above
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 7/10
20. A function with parameters cannot be decorated. * 1/1
True
False
21. Which of the following is correct? * 2/2
A. 5
B. 6
C. 0
D. Error
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 8/10
22. Which of the following is false with respect to Python 1/1
code? *
A. "std" is the reference variable for object Student(1,20)
B. id and age are called the parameters.
C. Every class must have a constructor.
D. None of the above
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=A… 9/10
23. What will be the output of the below Python code? * 2/2
A. 100 100
B. 100 102
C. 102 102
D. Error
This content is neither created nor endorsed by Google. - Terms of Service - Privacy Policy
Forms
https://docs.google.com/forms/d/e/1FAIpQLSeBQrIDFVhouB-pgUbro4MgPAAouBKsA1Ztr77c0r0Ui8-7Hg/viewscore?viewscore=… 10/10