Unit 5: Object-Oriented Programming in Python
Unit 5: Object-Oriented Programming in Python
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
A. Objects are real world entities while classes are not real.
B. Classes are real world entities while objects 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.
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
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
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
True
False
a) method
b) delete method
c) destructor
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)
15. The class from which the child class inherits is called 1/1
________ *
i) Child class
v) Both ii and iv
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
a) self
b) pass
c) super
d) assert
a) string representation
b) object representation
c) both a and b
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
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? *
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