Data Abstraction, Encapsulation, Math and Datetime Modules

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/10

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

11 Terms

1
New cards

Data Abstraction

Used to hide the internal functionality of the function from the users

2
New cards

Abstract Class

A class that consists of one or more abstract methods. Blueprint of other classes

3
New cards

Abstract Base Classes (ABC)

Works by decorating methods of the base class as abstract. Registers concrete classes as the implementation of the abstract base

4
New cards

@abstractmethod decorator

To define an abstract method or if we don't provide the definition to the method, it automatically becomes the abstract method.

5
New cards

@property decorator

Used to give special functionality to a method.

6
New cards

Encapsulation

Wrapping data and its methods in one unit. Can prevent accidental modification of data by putting access restrictions on variables and methods.

7
New cards

Public

Variables or methods can be accessed both inside and outside the class.

8
New cards

Protected

Variables or methods can be accessed only within the class and its subclasses. Denoted by a single underscore prefix

9
New cards

Private

Variables or methods can be accessed only within the class. Denoted by a double underscore prefix.

10
New cards

math Module

Built-in module for mathematical tasks. Has a set of methods and constants

11
New cards

datetime Module

Used to work with dates as date objects. Date contains year, month, day, hour, minute, second, and microsecond