Topic: Chapter 10: Python Classes and objects (Test 1)



Topic: Chapter 10: Python Classes and objects
  • «
  • Test: 1(current)
  • «
Q.1
Which of the following are the key features of an Object Oriented Programming language?
A. Constructor and Classes
B. Constructor and Object
C. Classes and Objects
D. Constructor and Destructor
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.2
Functions defined inside a class:
A. Functions
B. Module
C. Methods
D. section
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3
Class members are accessed through which operator?
A. &
B. .
C. #
D. %
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.4
Which of the following method is automatically executed when an object is created?
A. __object__( )
B. __del__( )
C. __func__( )
D. __init__( )
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.5
A private class variable is prefixed with
A. __
B. &&
C. ##
D. **
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.6
Which of the following method is used as destructor?
A. __init__( )
B. __dest__( )
C. __rem__( )
D. __del__( )
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.7
Which of the following class declaration is correct?
A. class class_name
B. class class_name<> (
C. class class_name:
D. class class_name[ ]
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.8

Which of the following is the output of the following program? class Student:

def __init__(self, name):

self.name=name

S=Student(“Tamil”)
A. Error
B. Tamil
C. name
D. self
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9
Which of the following is the private class variable?
A. __num
B. ##num
C. $$num
D. &&num
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
The process of creating an object is called as:
A. Constructor
B. Destructor
C. Initialize
D. Instantiation
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report


  • «
  • Test: 1(current)
  • «