LESSON 5 Flashcards

1
Q

ENCAPSULATION is also known as

A

DATA HIDING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Python is always Private (True or false)

A

False - PUBLIC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

loophole of python is not secured (true or false)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Python uses “ _ _ “ in order to be Object Oriented Paradigm (True or false)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

● ____ is one of the
important building blocks of object oriented programming which
enables the wrapping of all data
(attributes and methods) into a
single component(class)
● This prevents the accidental
modification of data by imposing
some restrictions on accessing
variables or methods directly.

A

Encapsulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

is the process of hiding
the data of an entity from others to
prevent the accidental modification
of data by other entities

A

Data hiding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Based on the visibility of the object’s attribute in a
class, they can be classified in two, which are __

A

private and public

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If a data member or member function is
accessible from any part of the program, it is
considered as

A

public

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

If its visibility is restricted to the defined class, then
it is considered as

A

private

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Access modifiers are ___ elements of
object-oriented programming as they restrain the
access to the attributes and methods in a class.

A

inevitable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Python does have specific access modifiers
like C, Java, and other languages. (True or False)

A

False - DOES NOT HAVE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Python being an object-oriented programming
language makes use of underscores to perform
the function of access modifiers that are done in
other languages (True or False)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In Python, all attributes are private by default. (True or False)

A

FALSE - PUBLIC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Any data or member function that prefixes with
double underscore is private to that class (TRUE OR FALSE)

A

(True)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

● ___ is the process of hiding internal
implementation of a process from its end user,
showing only essential features of data to the
external world
● This is done to reduce complexity and increase
efficiency.
● In the context of programming, isolating the
signature of a method from its definition is known

A

Abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Abstraction in Python is achieved through the use of
abstract classes and methods in programs (TRUE OR FALSE)

A

TRUE

15
Q

Benefits of Encapsulation

A

● The attributes of a class can be made read-only or
write-only.
● A class can have total control over what is stored in its
attributes.
● The users of a class do not know how the class stores its
data. A class can change the data type of a field and
users of the class do not need to change any of their
code

16
Q

● It generally focuses on ideas rather than the
functionality. This means the user is only familiar to
“what it does”, not on “how it does it”.

A

ABSTRACTION

17
Q

is a class which contains one or more
abstract methods.

A

abstract class

18
Q

A class becomes an abstract class if and only if it contains
at least one abstract method (TRUE OR FALSE)

A

TRUE

19
Q

A method is said to be an abstract method if it is declared
and defined. (TRUE OR FALSE)

A

FALSE - DECLARED BUT NOT DEFINED

20
Q

Python does not support any abstract
class, but we can achieve it by importing a class
named

A

ABC(Abstract Base Class)

21
Q

Abstract methods, on the other hand, are created by
using the

A

pass parameter

22
Q

An Abstract class in Python can contain the both
normal and abstract method, unlike in others where
an abstract class should only contain abstract
methods. (TRUE OR FALSE)

A

TRUE

23
Q

Creating an object of an abstract class in Python will
not result in any errors, unlike in others that will result
in ___, since abstract classes cannot be
instantiated

A

TypeError