0% found this document useful (0 votes)
27 views

34.classes & Objects (OOPS)

The document discusses object-oriented programming concepts like classes and objects, explaining that a class is a collection of objects that share common attributes and behaviors, while an object is an instance of a class that has both state and behavior. It also compares OOP and procedural programming, noting that OOP makes development and maintenance easier by dividing code into reusable classes and hiding implementation details through encapsulation.

Uploaded by

Subhojit Singha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

34.classes & Objects (OOPS)

The document discusses object-oriented programming concepts like classes and objects, explaining that a class is a collection of objects that share common attributes and behaviors, while an object is an instance of a class that has both state and behavior. It also compares OOP and procedural programming, noting that OOP makes development and maintenance easier by dividing code into reusable classes and hiding implementation details through encapsulation.

Uploaded by

Subhojit Singha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Classes & Objects (OOPS)

So, guys in this course we are working on PyCharm IDE.


There are also many other options available like Spyder,
Idle, Wing, etc. but we will go with PyCharm for this series
and you will see its benefits in the upcoming tutorials. If
you haven't downloaded it yet then download it by clicking
on the Download PyCharm. This will take you to the
PyCharm official site.

Figure1: Download PyCharm

I will recommend you installing the community version as


the other one will expire after a month trial and after that,
you have to pay to use its features. You can check
our Downloading Python and Pycharm
Installation tutorial for installation guidance.

Python is a powerful programming language that supports


the object-oriented programming paradigm. In object-
oriented programming, the program splits into self-
contained objects. Each object is representing a different
part of the application which can communicate among
themselves. We will be discussing classes and objects in
more detail in the next tutorial i.e, Creating Our First
Class In Python. The primary focus of this tutorial is to
give you the understanding of Object-Oriented
Programming or in short form OOP. A programming
technique that requires the use of objects and classes is
known as OOP. Object-Oriented Programming is based on
the principle of writing reusable code that can be
accessed multiple times by the user.

What is Python Class And Object?

A class is a collection of objects, and an object is defined


as an instance of class possessing attributes. The object
is an entity that has state and behavior. A class has all the
similar attributes, like if we have a class students, then it
will only consist of students related data, such as
subjects, names, attendance ratio, etc.

Along with classes and objects, you will learn many new
terminologies related to OOP in further tutorials. Some of
these terminologies are:

 Instances
 Constructor
 Methods
 Abstraction
 Inheritance

By using oop, we can divide our code into many sections


known as classes. Each class holds a distinct purpose or
usage. For example, if we have created a class named
"Books" then all the attributes it possesses should be
related to books such as the number of pages, publishing
date or price, etc.
There is no limit to the number of classes we can create
in a program. Also, one class can be easily accessible by
another, and we can also restrict the access of a class so
other classes can not use its functions. This concept
comes in handy while working on bigger projects. All the
employees are given separate tasks to work on the
classes they have been assigned. And after they are done
with their contribution, the classes can be combined as a
whole to form a complete project. So, now you can
understand that to become a successful programmer, you
must master the concept of OOP.

Object-oriented vs. Procedure-oriented Programming

Index Object-oriented programming Procedure Oriented Programming


Object-oriented programming is the It is Structure oriented. Procedural
1 problem-solving approach. The programming uses a list of instructions. It
computation is done by using objects. performs the computation step by step.
OOP makes development and When the project becomes lengthy, it is not
2
maintenance easier. easy to maintain the code.
OOP provides a proper way for data Procedural programming does not provide
hiding. It is more secure than procedural any proper way for data binding, so it is less
3
programming. You cannot access private secure. In Procedural programming, we can
data from anywhere. access the private data.
4 Program is divided into objects The program is divided into functions.
In this tutorial, we have discussed the basics of object-
oriented programming. In the next tutorial Creating Our
First Class in Python, we will start implementing
the OOP concepts.

Code file as described in the video


# Classes - Template
# Object - Instance Of the Class

# DRY - Do not repeat Yourself

# get_no_of_films(table)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy