Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

9608_Ch27_OOP

Total questions: 54

Worksheet time: 29mins

Name
Class
Date
1.

What is a class (in python)?

a)

A user-defined prototype for an object that defines a set of attributes that characterize any object of this. The attributes are data members and methods, accessed via dot notation.

b)

A special kind of function that is defined in a class definition.

c)

The assignment of more than one behavior to a particular function. The operation performed varies by the types of objects or arguments involved.

d)

the system of ordering a society in which people are divided into sets based on perceived social or economic status.

2.

What is a data member (in python)?

a)

A class variable or instance variable that holds data associated with a class and its objects.

b)

a person who is part of the club DATA

c)

A variable that is defined inside a method and belongs only to the current instance of a class.

d)

An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

3.

What does function overloading mean (in python)?

a)

An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

b)

A user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members (class variables and instance variables) and methods, accessed via dot notation.

c)

the function overloads and kills the computer

d)

The assignment of more than one behavior to a particular function. The operation performed varies by the types of objects or arguments involved.

4.

What is an instance variable (in python)?

a)

An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

b)

A variable that is defined inside a method and belongs only to the current instance of a class.

c)

The transfer of the characteristics of a class to other classes that are derived from it.

d)

A special kind of function that is defined in a class definition.

5.

What does inheritance mean in python?

a)

The transfer of the characteristics of a class to other classes that are derived from it.

b)

A variable that is defined inside a method and belongs only to the current instance of a class

c)

The creation of an instance of a class.

d)

It is what you sometimes get when a relative passes away

6.

What is an instance in python?

a)

A special kind of function that is defined in a class definition.

b)

The creation of an instance of a class.

c)

An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

d)

A moment in time

7.

What is instantiation in python?

a)

The creation of an instance of a class.

b)

The transfer of the characteristics of a class to other classes that are derived from it.

c)

A variable that is defined inside a method and belongs only to the current instance of a class.

d)

A unique instance of a data structure that's defined by its class. An object comprises both data members (class variables and instance variables) and methods.

8.

What is a method in python?

a)

a way of doing something

b)

a special kind of function that is defined in a class definition

c)

the creation of an instance of a class

d)

orderliness of thought or behavior; systematic planning or action

9.

What is an object in python?

a)

A unique instance of a data structure that's defined by its class. An object comprises both data members (class variables and instance variables) and methods.

b)

A special kind of function that is defined in a class definition.

c)

The assignment of more than one function to a particular operator.

d)

An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

10.

What is operator overloading in python?

a)

None of the answers

b)

The operator is overloaded and explodes

c)

A unique instance of a data structure that's defined by its class. An object comprises both data members (class variables and instance variables) and methods.

d)

The assignment of more than one function to a particular operator.

11.
Which of the following concepts of OOPS means exposing only necessary information to client?
a)
Encapsulation
b)
Abstraction
c)
Data hiding
d)
Data binding
12.
How many objects can be made from a class? 
a)
None, you make classes from objects
b)
one
c)
As many as you want
d)
All of the above
13.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
14.
Which one is not the basic element of OOP?
a)
Class
b)
Abstraction
c)
BlueJ
d)
Polymorphism
15.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
16.
These have identity, state, and behavior.
a)
class
b)
object
c)
method
d)
void
17.
As a blueprint is a design for a house, a class is a design for a(n):
a)
object
b)
variable
c)
constant
d)
statement
18.
The process by which objects of one class acquire the properties of objects of another class is known as
a)
Polymorphism
b)
Inheritance
c)
Data Hiding
d)
None of the above.
19.
The wrapping up of data and functions into a single unit is called
a)
overloading
b)
class
c)
object
d)
encapsulation 
20.
Which of the following statements is incorrect?
a)
Class is an object factory
b)
Class is a composite type.
c)
Class is an instance of an object.
d)
Class is a user defined type.
21.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
22.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
23.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
24.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
25.

Is python an interpreter or compiler programming language?

a)

Compiler

b)

Interpreter

26.

Python is uses braces to block off code

a)

True

b)

False

27.

Python uses indentation to block code into chunks

a)

True

b)

False

28.

Python correct naming convention for variables is?

a)

new_user25

b)

NewUser25

c)

25_new_user

d)

25NewUser

e)

NEWUSER25

29.

Which defines the class Student?

a)

class Student:

b)

Class Student:

c)

class Student():

d)

def Student():

30.

Which code defines the class Student, inherits from class Person?

a)

class Student(Person):

b)

Class Student extends Person:

c)

class Student <--Person:

d)

class Student : class Person:

31.

Procedural programming lays stress on?

a)

Data

b)

Functions

c)

Object

d)

Class

32.

(a)   can be used as a bridge to have data flow from one function to another.

33.

________ is wrapping of data into a single unit called class.

a)

Abstraction

b)

Polymorphism

c)

Encapsulation

d)

Inheritance

34.

__________ refers to the act of representing essential details.

a)

Polymorphism

b)

Abstraction

c)

Inheritance

d)

Encapsulation

35.

__________ is the process in which objects of one class can link and share some common properties from the objects of another class.

a)

Abstraction

b)

Inheritance

c)

Polymorphism

d)

Encapsulation

36.

__________ is the process of using a function for more than one purpose. It allows the use of different internal structures of the object by keeping the same external interface.

a)

Inheritance

b)

Polymorphism

c)

Abstraction

d)

Encapsulation

37.

Which of the following adopts top down approach?

a)

Object Oriented Programming

b)

Procedural Programming

38.

An _________ is an instance or of a copy of a class.

a)

Class

b)

Object

c)

Attribute

39.

Choose the correct titles for column 1 & Column 2

a)

Data Abstraction & Data Hiding

b)

Data Hiding & Data Abstraction

c)

None Of These

40.

(a)   keyword is used for allocating dynamic memory of the object

41.

Class is known as (a)   datatype.

42.

A programming mechanism that binds together code and the data it manipulates, and that keeps both safe from outside interference and misuse.

a)

Polymorphism

b)

Inheritance

c)

Encapsulation

d)

Object-Oriented Programming

43.

(from Greek meaning “many forms”) is the quality that allows one interface to access a general class of actions.

a)

Polymorphism

b)

Inheritance

c)

Encapsulation

d)

Object-Oriented Programming

44.

Is the process by which one object can acquire the properties of another object.

a)

Polymorphism

b)

Inheritance

c)

Encapsulation

d)

Object-Oriented Programming

45.

Select all the given characteristic of OOP

a)

Data structures are designed such that they characterize the objects.

b)

C input/output is based on library and the processes are carried out by including functions.

c)

Programs are divided into what are known as objects.

d)

Emphasis is on data rather than procedure

46.

Which of the following option leads to the portability and security of Java?

a)

Bytecode is executed by JVM

b)

The applet makes the Java code secure and portable

c)

Use of exception handling

d)

Dynamic binding between objects

47.

Java uses two stage system for program execution. They are

a)

Compiler and instruction

b)

Compiler and interpreter

c)

Copy and compiler

d)

None

48.

We can iterate over string

a)

True

b)

False

49.

Which mathematical concept is fit to text data (e.g. words in documents)

a)

Set

b)

Bag

c)

List

d)

Tuple

50.

There are 40 students in a classroom. We would like to get all students whose name starts with "A". Which looping is suitable?

a)

For loop

b)

While loop

51.

Which data type is the best to store possible outcome of tossing a dice?

a)

Tuple

b)

List

c)

Dictionary

52.

You are in the car with traffic jammed at a junction. To cross that junction according to the traffic rules, which one is NOT applicable

a)

While loop

b)

Conditional Statement

c)

For loop

53.

You want to sampling 10 from 100 patients (One-by-One). Which one does NOT necessary in your code?

a)

For loop

b)

While loop

c)

Conditional Statement

d)

Set

54.

Patients visit hospital everyday. You want to count for the "new patients" for each day. Which one is not necessary?

a)

Set

b)

While loop

c)

For loop

d)

Set difference