SlideShare a Scribd company logo
Introduction to Python for Data
Science
Replay
Module 2 :Overview of Data Science Tools and Technologies
• Introduction to popular data science tools such as R
• Introduction to popular data science tools such as SQL
• Overview of machine learning algorithms and their applications
Session 7:Python programming
Concepts
Python Advance Topics
• Functions
• Classes
• Objects
• Methods
• Constructor
• OOPS
Inheritance
Encapsulation
Polymorphism
Abstraction
Functions with no arguments
• Python Functions is a block of statements that return the
specific task. The idea is to put some commonly or repeatedly
done tasks together and make a function so that instead of
writing the same code again and again for different inputs, we
can do the function calls to reuse code contained in it over and
over again.
Use function arguments in Python
• Information can be passed into
functions as arguments. Arguments
are specified after the function name,
inside the parentheses. You can add as
many arguments as you want, just
separate them with a comma.
• A parameter is the variable listed inside
the parentheses in the function
definition.
• An argument is the value that are sent
to the function when it is called.
The terms parameter and argument can be used for the same thing: information that are passed into a
function.
OOPS
Object-Oriented Programming (OOPs) is a programming
paradigm that uses objects and classes in programming.
OOPs, concepts in python, aim to implement real-world
entities like inheritance, polymorphisms, encapsulation,
etc., in the programming.
The concept of OOP in Python focuses on building
efficient and reusable code. This is also known as DRY
(don't repeat yourself).
How to Create a Class in Python
• A Class is like an object
constructor, or a "blueprint"
for creating objects.
• A class is created using the
keyword class.
• Attributes refer to variables
that belong to a class.
• These attributes are always
public, and you can access
them using a dot (.).
class ClassName:
#statement_suite
# Declare an object of a class
object_name = ClassName(argume
nts)
Method and Constructor in
Python
Methods are essential components of
Python object-oriented programming
(OOP) as they encapsulate the functionality
associated with the objects.
Method
Class Games:
X=100
Def value(self):
print(self.X)
Obj=Games()
Obj.value()
Constructors are generally used for instantiating an
object. The task of constructors is to initialize(assign
values) to the data members of the class when an
object of the class is created. In Python the __init__()
method is called the constructor and is always
called when an object is created.
Constructor
class Games:
# default constructor
def __init__(self):
print(“welcome”)
# creating object of the class
obj = Games()
Inheritance
• Inheritance is the capability of one class to derive or inherit the
properties from another class. The class that derives properties is
called the derived class or child class and the class from which the
properties are being derived is called the base class or parent class.
Encapsulation
Encapsulation is one of the fundamental concepts in object-
oriented programming (OOP). It describes the idea of wrapping
data and the methods that work on data within one unit. This puts
restrictions on accessing variables and methods directly and can
prevent the accidental modification of data. To prevent accidental
change, an object’s variable can only be changed by an object’s
method. Those types of variables are known as private variables.
A class is an example of encapsulation as it encapsulates all the
data that is member functions, variables, etc.
Polymorphism
• Poly' means multiple and 'morph' means forms. So, polymorphism altogether
means something that has multiple forms. Or, 'some thing' that can have
multiple behaviours depending upon the situation.
• Polymorphism in OOPS refers to the functions having the same names but
carrying different functionalities. Or, having the same function name, but
different function signature(parameters passed to the function).
Abstraction
• Abstraction just shows us the functionalities anything holds, hiding all the
implementations or inner details.
• The main goal of Abstraction is to hide background details or any unnecessary
implementation about the data so that users only see the required information. It
helps in handling the complexity of the codes.
• Abstraction can be achieved by using abstract classes
• A class that consists of one or more abstract methods is called the "abstract class".
• Abstract class can be inherited by any subclass. The subclasses that inherit the
abstract classes provide the implementations for their abstract methods.
• Abstract classes can act like blueprint to other classes, which are useful when we
are designing large functions. And the subclass which inherits them can refer to the
abstract methods for implementing the features.
Q N A
Q What are access specifiers? What is
their significance in OOPs?
Q How is an abstract class different from an
interface?
Q How much memory does a class
occupy?

More Related Content

Similar to Python programming Concepts (Functions, classes and Oops concept (20)

Unit – V Object Oriented Programming in Python.pptx
Unit – V Object Oriented Programming in Python.pptxUnit – V Object Oriented Programming in Python.pptx
Unit – V Object Oriented Programming in Python.pptx
YugandharaNalavade
 
slides11-objects_and_classes in python.pptx
slides11-objects_and_classes in python.pptxslides11-objects_and_classes in python.pptx
slides11-objects_and_classes in python.pptx
debasisdas225831
 
Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
مقدمة بايثون .pptx
مقدمة بايثون .pptxمقدمة بايثون .pptx
مقدمة بايثون .pptx
AlmutasemBillahAlwas
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
OOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptxOOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptx
SofiMusic
 
Class and Objects in python programming.pptx
Class and Objects in python programming.pptxClass and Objects in python programming.pptx
Class and Objects in python programming.pptx
Rajtherock
 
Unit - 3.pptx
Unit - 3.pptxUnit - 3.pptx
Unit - 3.pptx
Kongunadu College of Engineering and Technology
 
07slide.ppt
07slide.ppt07slide.ppt
07slide.ppt
NuurAxmed2
 
Regex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overlodingRegex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overloding
sangumanikesh
 
UNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHON
UNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHONUNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHON
UNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHON
drkangurajuphd
 
Object oriented programming 6 oop with c++
Object oriented programming 6  oop with c++Object oriented programming 6  oop with c++
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
Object-Oriented Programming (OO) in pythonP) in python.pptx
Object-Oriented Programming (OO)  in pythonP)  in python.pptxObject-Oriented Programming (OO)  in pythonP)  in python.pptx
Object-Oriented Programming (OO) in pythonP) in python.pptx
institute of Geoinformatics and Earth Observation at PMAS ARID Agriculture University of Rawalpindi
 
python.pptx
python.pptxpython.pptx
python.pptx
Dhanushrajucm
 
IPP-M5-C1-Classes _ Objects python -S2.pptx
IPP-M5-C1-Classes _ Objects python -S2.pptxIPP-M5-C1-Classes _ Objects python -S2.pptx
IPP-M5-C1-Classes _ Objects python -S2.pptx
DhavalaShreeBJain
 
Object Oriented Programming.pptx
Object Oriented Programming.pptxObject Oriented Programming.pptx
Object Oriented Programming.pptx
SAICHARANREDDYN
 
object oriented porgramming using Java programming
object oriented porgramming using Java programmingobject oriented porgramming using Java programming
object oriented porgramming using Java programming
afsheenfaiq2
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Introduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptxIntroduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptx
cpics
 
object-class_in python programming .pptx
object-class_in python programming .pptxobject-class_in python programming .pptx
object-class_in python programming .pptx
SnehasisGhosh10
 
Unit – V Object Oriented Programming in Python.pptx
Unit – V Object Oriented Programming in Python.pptxUnit – V Object Oriented Programming in Python.pptx
Unit – V Object Oriented Programming in Python.pptx
YugandharaNalavade
 
slides11-objects_and_classes in python.pptx
slides11-objects_and_classes in python.pptxslides11-objects_and_classes in python.pptx
slides11-objects_and_classes in python.pptx
debasisdas225831
 
Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
OOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptxOOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptx
SofiMusic
 
Class and Objects in python programming.pptx
Class and Objects in python programming.pptxClass and Objects in python programming.pptx
Class and Objects in python programming.pptx
Rajtherock
 
Regex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overlodingRegex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overloding
sangumanikesh
 
UNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHON
UNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHONUNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHON
UNIT 3 PY.pptx - OOPS CONCEPTS IN PYTHON
drkangurajuphd
 
Object oriented programming 6 oop with c++
Object oriented programming 6  oop with c++Object oriented programming 6  oop with c++
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
IPP-M5-C1-Classes _ Objects python -S2.pptx
IPP-M5-C1-Classes _ Objects python -S2.pptxIPP-M5-C1-Classes _ Objects python -S2.pptx
IPP-M5-C1-Classes _ Objects python -S2.pptx
DhavalaShreeBJain
 
Object Oriented Programming.pptx
Object Oriented Programming.pptxObject Oriented Programming.pptx
Object Oriented Programming.pptx
SAICHARANREDDYN
 
object oriented porgramming using Java programming
object oriented porgramming using Java programmingobject oriented porgramming using Java programming
object oriented porgramming using Java programming
afsheenfaiq2
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Introduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptxIntroduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptx
cpics
 
object-class_in python programming .pptx
object-class_in python programming .pptxobject-class_in python programming .pptx
object-class_in python programming .pptx
SnehasisGhosh10
 

More from Lipika Sharma (11)

Importing data from various sources (CSV, Excel, SQL)
Importing data from various sources (CSV, Excel, SQL)Importing data from various sources (CSV, Excel, SQL)
Importing data from various sources (CSV, Excel, SQL)
Lipika Sharma
 
Basic data manipulation with pandas pandas
Basic data manipulation with pandas pandasBasic data manipulation with pandas pandas
Basic data manipulation with pandas pandas
Lipika Sharma
 
Introduction to Jupyter Notebooks and Anaconda
Introduction to Jupyter Notebooks and AnacondaIntroduction to Jupyter Notebooks and Anaconda
Introduction to Jupyter Notebooks and Anaconda
Lipika Sharma
 
Introduction to data visualization tools like Tableau and Power BI and Excel
Introduction to data visualization tools like Tableau and Power BI  and ExcelIntroduction to data visualization tools like Tableau and Power BI  and Excel
Introduction to data visualization tools like Tableau and Power BI and Excel
Lipika Sharma
 
Overview of machine learning algorithms and their applications
Overview of machine learning algorithms and their applicationsOverview of machine learning algorithms and their applications
Overview of machine learning algorithms and their applications
Lipika Sharma
 
Introduction to popular data science tools such as R, and SQL
Introduction to popular data science tools such as R, and SQLIntroduction to popular data science tools such as R, and SQL
Introduction to popular data science tools such as R, and SQL
Lipika Sharma
 
Introduction to python and its basics (variables, data types, control structures
Introduction to python and its basics (variables, data types, control structuresIntroduction to python and its basics (variables, data types, control structures
Introduction to python and its basics (variables, data types, control structures
Lipika Sharma
 
Importance of data science in modern business environments
Importance of data science in modern business environmentsImportance of data science in modern business environments
Importance of data science in modern business environments
Lipika Sharma
 
Introduction to Data Science and its Scope
Introduction to Data Science  and its ScopeIntroduction to Data Science  and its Scope
Introduction to Data Science and its Scope
Lipika Sharma
 
NLP PPT.pptx
NLP PPT.pptxNLP PPT.pptx
NLP PPT.pptx
Lipika Sharma
 
Current banking scenario and Job opportunities in banking
Current banking scenario and Job opportunities in bankingCurrent banking scenario and Job opportunities in banking
Current banking scenario and Job opportunities in banking
Lipika Sharma
 
Importing data from various sources (CSV, Excel, SQL)
Importing data from various sources (CSV, Excel, SQL)Importing data from various sources (CSV, Excel, SQL)
Importing data from various sources (CSV, Excel, SQL)
Lipika Sharma
 
Basic data manipulation with pandas pandas
Basic data manipulation with pandas pandasBasic data manipulation with pandas pandas
Basic data manipulation with pandas pandas
Lipika Sharma
 
Introduction to Jupyter Notebooks and Anaconda
Introduction to Jupyter Notebooks and AnacondaIntroduction to Jupyter Notebooks and Anaconda
Introduction to Jupyter Notebooks and Anaconda
Lipika Sharma
 
Introduction to data visualization tools like Tableau and Power BI and Excel
Introduction to data visualization tools like Tableau and Power BI  and ExcelIntroduction to data visualization tools like Tableau and Power BI  and Excel
Introduction to data visualization tools like Tableau and Power BI and Excel
Lipika Sharma
 
Overview of machine learning algorithms and their applications
Overview of machine learning algorithms and their applicationsOverview of machine learning algorithms and their applications
Overview of machine learning algorithms and their applications
Lipika Sharma
 
Introduction to popular data science tools such as R, and SQL
Introduction to popular data science tools such as R, and SQLIntroduction to popular data science tools such as R, and SQL
Introduction to popular data science tools such as R, and SQL
Lipika Sharma
 
Introduction to python and its basics (variables, data types, control structures
Introduction to python and its basics (variables, data types, control structuresIntroduction to python and its basics (variables, data types, control structures
Introduction to python and its basics (variables, data types, control structures
Lipika Sharma
 
Importance of data science in modern business environments
Importance of data science in modern business environmentsImportance of data science in modern business environments
Importance of data science in modern business environments
Lipika Sharma
 
Introduction to Data Science and its Scope
Introduction to Data Science  and its ScopeIntroduction to Data Science  and its Scope
Introduction to Data Science and its Scope
Lipika Sharma
 
Current banking scenario and Job opportunities in banking
Current banking scenario and Job opportunities in bankingCurrent banking scenario and Job opportunities in banking
Current banking scenario and Job opportunities in banking
Lipika Sharma
 
Ad

Recently uploaded (20)

apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays
 
THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)
JishuHaldar
 
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
apidays
 
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptxLONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
vemuripraveena2622
 
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays
 
Tableau Finland User Group June 2025.pdf
Tableau Finland User Group June 2025.pdfTableau Finland User Group June 2025.pdf
Tableau Finland User Group June 2025.pdf
elinavihriala
 
Mining Presentation Online Courses for Student
Mining Presentation Online Courses for StudentMining Presentation Online Courses for Student
Mining Presentation Online Courses for Student
Rizki229625
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
MICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdfMICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdf
bathyates
 
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays
 
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptxSAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
vemulavenu484
 
Part Departement Head Presentation for Business
Part Departement Head Presentation for BusinessPart Departement Head Presentation for Business
Part Departement Head Presentation for Business
Rizki229625
 
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdfAG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
Anass Nabil
 
Math arihant handbook.pdf all formula is here
Math arihant handbook.pdf all formula is hereMath arihant handbook.pdf all formula is here
Math arihant handbook.pdf all formula is here
rdarshankumar84
 
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdfBODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
SiddharthSean
 
1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt
Wahajch
 
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays
 
Philippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitalityPhilippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitality
kikomendoza006
 
Managed Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud ManManaged Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud Man
Opsio Cloud
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays
 
THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)
JishuHaldar
 
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
apidays
 
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptxLONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
vemuripraveena2622
 
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays
 
Tableau Finland User Group June 2025.pdf
Tableau Finland User Group June 2025.pdfTableau Finland User Group June 2025.pdf
Tableau Finland User Group June 2025.pdf
elinavihriala
 
Mining Presentation Online Courses for Student
Mining Presentation Online Courses for StudentMining Presentation Online Courses for Student
Mining Presentation Online Courses for Student
Rizki229625
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
MICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdfMICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdf
bathyates
 
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays
 
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptxSAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
vemulavenu484
 
Part Departement Head Presentation for Business
Part Departement Head Presentation for BusinessPart Departement Head Presentation for Business
Part Departement Head Presentation for Business
Rizki229625
 
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdfAG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
Anass Nabil
 
Math arihant handbook.pdf all formula is here
Math arihant handbook.pdf all formula is hereMath arihant handbook.pdf all formula is here
Math arihant handbook.pdf all formula is here
rdarshankumar84
 
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdfBODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
SiddharthSean
 
1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt
Wahajch
 
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays
 
Philippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitalityPhilippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitality
kikomendoza006
 
Managed Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud ManManaged Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud Man
Opsio Cloud
 
Ad

Python programming Concepts (Functions, classes and Oops concept

  • 1. Introduction to Python for Data Science
  • 2. Replay Module 2 :Overview of Data Science Tools and Technologies • Introduction to popular data science tools such as R • Introduction to popular data science tools such as SQL • Overview of machine learning algorithms and their applications
  • 3. Session 7:Python programming Concepts Python Advance Topics • Functions • Classes • Objects • Methods • Constructor • OOPS Inheritance Encapsulation Polymorphism Abstraction
  • 4. Functions with no arguments • Python Functions is a block of statements that return the specific task. The idea is to put some commonly or repeatedly done tasks together and make a function so that instead of writing the same code again and again for different inputs, we can do the function calls to reuse code contained in it over and over again.
  • 5. Use function arguments in Python • Information can be passed into functions as arguments. Arguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma. • A parameter is the variable listed inside the parentheses in the function definition. • An argument is the value that are sent to the function when it is called. The terms parameter and argument can be used for the same thing: information that are passed into a function.
  • 6. OOPS Object-Oriented Programming (OOPs) is a programming paradigm that uses objects and classes in programming. OOPs, concepts in python, aim to implement real-world entities like inheritance, polymorphisms, encapsulation, etc., in the programming. The concept of OOP in Python focuses on building efficient and reusable code. This is also known as DRY (don't repeat yourself).
  • 7. How to Create a Class in Python • A Class is like an object constructor, or a "blueprint" for creating objects. • A class is created using the keyword class. • Attributes refer to variables that belong to a class. • These attributes are always public, and you can access them using a dot (.). class ClassName: #statement_suite # Declare an object of a class object_name = ClassName(argume nts)
  • 8. Method and Constructor in Python Methods are essential components of Python object-oriented programming (OOP) as they encapsulate the functionality associated with the objects. Method Class Games: X=100 Def value(self): print(self.X) Obj=Games() Obj.value() Constructors are generally used for instantiating an object. The task of constructors is to initialize(assign values) to the data members of the class when an object of the class is created. In Python the __init__() method is called the constructor and is always called when an object is created. Constructor class Games: # default constructor def __init__(self): print(“welcome”) # creating object of the class obj = Games()
  • 9. Inheritance • Inheritance is the capability of one class to derive or inherit the properties from another class. The class that derives properties is called the derived class or child class and the class from which the properties are being derived is called the base class or parent class.
  • 10. Encapsulation Encapsulation is one of the fundamental concepts in object- oriented programming (OOP). It describes the idea of wrapping data and the methods that work on data within one unit. This puts restrictions on accessing variables and methods directly and can prevent the accidental modification of data. To prevent accidental change, an object’s variable can only be changed by an object’s method. Those types of variables are known as private variables. A class is an example of encapsulation as it encapsulates all the data that is member functions, variables, etc.
  • 11. Polymorphism • Poly' means multiple and 'morph' means forms. So, polymorphism altogether means something that has multiple forms. Or, 'some thing' that can have multiple behaviours depending upon the situation. • Polymorphism in OOPS refers to the functions having the same names but carrying different functionalities. Or, having the same function name, but different function signature(parameters passed to the function).
  • 12. Abstraction • Abstraction just shows us the functionalities anything holds, hiding all the implementations or inner details. • The main goal of Abstraction is to hide background details or any unnecessary implementation about the data so that users only see the required information. It helps in handling the complexity of the codes. • Abstraction can be achieved by using abstract classes • A class that consists of one or more abstract methods is called the "abstract class". • Abstract class can be inherited by any subclass. The subclasses that inherit the abstract classes provide the implementations for their abstract methods. • Abstract classes can act like blueprint to other classes, which are useful when we are designing large functions. And the subclass which inherits them can refer to the abstract methods for implementing the features.
  • 13. Q N A
  • 14. Q What are access specifiers? What is their significance in OOPs?
  • 15. Q How is an abstract class different from an interface?
  • 16. Q How much memory does a class occupy?