wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

tl

Total questions: 35

Worksheet time: 19mins

Name
Class
Date
1.
Which of the following concepts of OOPS means exposing only necessary information to client?
a)
Encapsulation
b)
Abstraction
c)
Data hiding
d)
Data binding
2.
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
3.
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
4.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
5.
These have identitystate, and behavior.
a)
class
b)
object
c)
method
d)
void
6.
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
7.
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.
8.
The wrapping up of data and functions into a single unit is called
a)
overloading
b)
class
c)
object
d)
encapsulation 
9.
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.
10.

С помощью какой функции можно проверить принадлежность объекта к определенному классу?

a)

issubclass

b)

enumerate

c)

isinstance

d)

type

e)

setattr

11.

С помощью какой функции можно проверить тип объекта?

a)

issubclass

b)

enumerate

c)

isinstance

d)

type

e)

setattr

12.

Что будет напечатано в результате вызова данного кода?

a)

{'name': 'Serega', 'age': 88, 'salary': 15000}

b)

Serega

c)

88

d)

15000

13.

Каков будет результат последней команды кода?

a)

{'name': 'Serega', 'age': 88, 'salary': 25000}

b)

{'name': 'Serega', 'age': 88, 'salary': 15000}

c)

'Serega', 88, 25000

d)

NameError: name 'obj1' is not defined

14.

Каков будет результат последней команды кода?

a)

{'name': 'Serega', 'age': 88, 'salary': 25000}

b)

{'name': 'Serega', 'age': 88, 'salary': 15000}

c)

'Serega', 88, 25000

d)

NameError: name 'obj1' is not defined

15.

Что выведет на экран данная программа?

a)

0

b)

name

c)

Serega

d)

obj1

16.

Какой параметр должен обязательно присутствовать при определении метода класса

(a)  

17.

Получение нового типа объекта на основе уже существующей с частично или полностью наследованной от родителей функциональностью - это...

a)

полиморфизм

b)

инкапсуляция

c)

абстракция

d)

наследование

18.

Какое сообщение выведет данный код?

a)

25000

b)

15000

c)

AttributeError: 'Person' object has no attribute '__salary'

19.

Что будет выведено на экран в результате работы программы?

a)

15000

b)

AttributeError: 'Person' object has no attribute '_Person'

c)

25000

20.

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.

21.

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.

22.

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.

23.

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.

24.

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

25.

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

26.

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

27.

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.

28.

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.

29.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
30.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

31.

Welcher Code definiert die Klasse Student, die von der Oberklasse Person erbt?

a)

class Student(Person):

b)

Class Student extends Person:

c)

class Student <--Person:

d)

class Student : class Person:

32.

Was wird hier bei print(x.a, x.b) ausgegeben?

a)

10 12

b)

12 10

c)

a b

d)

x.a x.b

33.

Was macht diese Codezeile?


x = A()

a)

Ein Objekt x von der Klasse A erstellen

b)

Der Variablen x den Wert von "A()" zuweisen

c)

Den Parameter A ändern

d)

Klasse A hat den Wert von x nach dieser Zeile Code

34.

Welche Methode der Klasse A wird als erstes beim Erstellen des Objektes aufgerufen?

a)

erstes()

b)

__init__()

c)

zweites()

d)

keine der Methoden

35.

Was wird in dieser Zeile ausgegeben?

print (x.zweites(1,2))

a)

10 12

b)

22

c)

1 2

d)

3