SlideShare a Scribd company logo
FABRIKAM
OOP USING PYTHON BY E-BOX
S U M M E R T R A I N I N G
K A U S H A L K U M A R J H A
1 1 8 0 2 1 6 9
C S E 3 4 3
FABRIKAM
Python is a widely used general-purpose, high level programming language. Python is
designed to be highly readable. It uses English keywords frequently where as other
languages use punctuation, and it has fewer syntactical constructions than other
languages.
Python is a great programming language that supports OOP. You will use it to define a
class with attributes and methods, which you will then call. Python is a dynamic language,
with high-level data types. This means that development happens much faster than with
Java or C++.
Python does not require the programmer to declare types of variables and arguments.
This also makes Python easier to understand and learn for beginners, its code being more
readable and intuitive.
INTRODUCTION OF COURSE
2
FABRIKAM
REASON FOR CHOOSING THIS TECHNOLOGY
3
Python developers has a lot of scope in IT industries. Python is also a great language for
those who want to build their career in Data Science, AI or Machine Learning field.
There is wide scope and huge job opportunities for python programmers in India. Python is
one of the most versatile and powerful programming languages. There is an extensive use of
python programming language for both start-ups and corporate
Python is popular for providing wide range of functionalities and applications and various
packages and libraries, and hence making it easy to learn by newbies.
Python supports Multiple Programming Paradigms. It has large set of library and tools. It has
a vast community support. Python is designed for better code readability. It contains fewer
lines of codes. It is an open source, general purpose, and object-oriented programming
language.
FABRIKAMFABRIKAM
TOPICS COVERED
• INTRODUCTION TO PYTHON
• CLASSES AND OBJECTS
• INHERITANCE
• ABSTRACT CLASS AND INTERFACE
• STRING/LIST AND DICTIONARY
• EXCEPTION
• MULTITHREADING
• STREAMS
• LAMBDA
• DB CONNECTION
• POLYMORPHISM
• ENCAPSULATION AND ABSTRACTION
4
FABRIKAM
CLASSES AND OBJECTS
5
• Class: A class is a collection of objects or you can say it is a blueprint of objects defining the common
attributes and behavior.
Class is defined under a “Class” Keyword.
Example: class class1(): // class 1 is the name of the class
• Object: Objects are an instance of a class. It is an entity that has state and behavior. In a nutshell, it is
an instance of a class that can access the data.
Syntax: obj = class1()
Here obj is the “object” of class1.
FABRIKAM
Inheritance allows us to define a class that inherits all the methods and properties
from another class.
Parent class is the class being inherited from, also called base class.
Child class is the class that inherits from another class, also called derived class.
Types of Inheritance depends upon the number of child and parent classes involved.
There are four types of inheritance in Python:
Single Inheritance:
INHERITANCE
6
FABRIKAM 7
MULTIPLE INHERITANCE
HIERARCHICAL
INHERITANCE
MULTILEVEL
INHERITANCE
TYPES OF INHERITANCE
FABRIKAM
An abstract class can be considered as a blueprint for other classes. It allows you to create a set of
methods that must be created within any child classes built from the abstract class. A class which
contains one or more abstract methods is called an abstract class. An abstract method is a method
that has a declaration but does not have an implementation. While we are designing large functional
units we use an abstract class. When we want to provide a common interface for different
implementations of a component, we use an abstract class.
ABSTRACT CLASSES
8
FABRIKAM
Like many other popular programming languages, strings in Python are arrays of bytes representing
unicode characters. However, Python does not have a character data type, a single character is
simply a string with a length of 1. Square brackets can be used to access elements of the string.
String Length: To get the length of a string, use the len() function.
String Methods: Python has a set of built-in methods that we can use on strings.
• The lower() method returns the string in lower case.
• The upper() method returns the string in upper case.
• The replace() method replaces a string with another string.
• The strip() method removes any whitespace from the beginning or the end.
STRINGS
9
FABRIKAM
LISTS
10
List in Python are ordered and have definite count. The elements in a list are indexed according to a definite
sequence and the indexing of a list is done with 0 being the first index. Each element in the list has its definite
place in the list, which allows duplicating of elements in the list, with each element having its own distinct
place and credibility
Creating a list:
Lists in Python can be created by just placing the sequence inside the square brackets[].
Unlike Sets, list doesn’t need a built-in function for creation of list.
FABRIKAM
Dictionary in Python is an unordered collection of data values, used to store data values like a map, which unlike other Data
Types that hold only single value as an element, Dictionary holds key:value pair. Key value is provided in the dictionary to
make it more optimized.
Creating a dictionary: In Python, a Dictionary can be created by placing sequence of elements within curly {} braces,
separated by ‘comma’. Dictionary holds a pair of values, one being the Key and the other corresponding pair element being
its key: value. Values in a dictionary can be of any datatype and can be duplicated, whereas keys can’t be repeated and must
be immutable. Accessing Values: We can access the items of a dictionary by referring to its key name, inside square brackets.
Built-In Functions:
• cmp(dict1,dict2)
• len(dict)
• type(variable)
DICTIONARY
11
FABRIKAM
An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's
instructions. In general, when a Python script encounters a situation that it cannot cope with, it raises an exception. An
exception is a Python object that represents an error. When a Python script raises an exception, it must either handle the
exception immediately otherwise it terminates and quits.
Handling an exception:
If we have some suspicious code that may raise an exception, we can defend your program by placing the suspicious code in
a try: block. After the try: block, include an except: statement, followed by a block of code which handles the problem as
elegantly as possible.
EXCEPTION
12
FABRIKAM
A thread is the smallest unit of processing that can be performed in an OS. Multithreading is defined as the
ability of a processor to execute multiple threads concurrently.
There are two kinds of threads:
1) Kernel threads
2) User-space threads or user threads
Advantages of Threading:
• Multithreaded programs can run faster on computer systems with multiple CPUs, because theses threads
can be executed truly concurrent.
• A program can remain responsive to input. This is true both on single and on multiple CPU
• Threads of a process can share the memory of global variables. If a global variable is changed in one thread,
this change is valid for all threads. A thread can have local variables.
MULTITHREADING
13
FABRIKAM
StremReader: wraps or contain a stream
StreamReader defines: read and other respective methods to read the data from the stream and ‘decode’
them.
stream must be a file-like object open for reading(binary) data.
StreamReader(stream[,errors]) - Constructor for a StreamReader instance.
The StreamReader implement different error handling schemes by providing the errors keyword argument.
These parameters are defined:
• ‘strict’ raise ValueError (or a subclass); this is the default.
• ‘ignore’ Ignore the character and continue with the next.
• ‘replace’ Replace with a suitable replacement character.
STREAMS
14
FABRIKAM
• A lambda function is a small anonymous function.
• A lambda function can take any number of arguments, but can only have one expression.
Syntax:
lambda arguments : expression
Example
Add 10 to argument a, and return the result:
x= lambda a : a+10
print(x(5))
Output: 15
LAMBDA
15
FABRIKAM
The Python programming language has powerful features for database programming. Python supports
various databases like MySQL, Oracle, Sybase, PostgreSQL, etc. Python also supports Data Definition Language
(DDL), Data Manipulation Language (DML) and Data Query Statements. For database programming, the
Python DB API is a widely used module that provides a database application programming interface.
There are many good reasons to use Python for programming database applications:
• Programming in Python is arguably more efficient and faster compared to other languages.
• Python is famous for its portability.
• It is platform independent.
• Python supports SQL cursors.
DB CONNECTION
16
FABRIKAM
LEARNING OUTCOMES
 Mastered the fundamentals of writing Python scripts
 Learned core Python scripting elements such as
variables and flow control structures
 Discovered how to work with lists and sequence data
 Write Python functions to facilitate code reuse
 Use Python to read and write files
 Make their code robust by handling errors and
exceptions properly
 Work with the Python standard library
 Learned to acquire Object Oriented Skills in Python
17
FABRIKAM
THANK YOU

More Related Content

What's hot

Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming LanguageLaxman Puri
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Maulik Borsaniya
 
Python Tutorial for Beginner
Python Tutorial for BeginnerPython Tutorial for Beginner
Python Tutorial for Beginner
rajkamaltibacademy
 
Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installing
Mohd Sajjad
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu Sharma
Mayank Sharma
 
Python for All
Python for All Python for All
Python for All
Pragya Goyal
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
Sudhriti Gupta
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
Prof. Dr. K. Adisesha
 
Python basics
Python basicsPython basics
Python basics
Jyoti shukla
 
An Introduction to Python Programming
An Introduction to Python ProgrammingAn Introduction to Python Programming
An Introduction to Python Programming
Morteza Zakeri
 
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
Nicholas Pringle
 
Most Asked Python Interview Questions
Most Asked Python Interview QuestionsMost Asked Python Interview Questions
Most Asked Python Interview Questions
Shubham Shrimant
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Yi-Fan Chu
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
Samir Mohanty
 
Type hints in python & mypy
Type hints in python & mypyType hints in python & mypy
Type hints in python & mypy
Anirudh
 
Intro to python
Intro to pythonIntro to python
Intro to python
Mohamed Essam
 
Java Basics
Java BasicsJava Basics
Java Basics
shivamgarg_nitj
 
The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202
Mahmoud Samir Fayed
 
Python
PythonPython
Python
Aashish Jain
 
An Introduction to ANTLR
An Introduction to ANTLRAn Introduction to ANTLR
An Introduction to ANTLR
Morteza Zakeri
 

What's hot (20)

Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Python Tutorial for Beginner
Python Tutorial for BeginnerPython Tutorial for Beginner
Python Tutorial for Beginner
 
Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installing
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu Sharma
 
Python for All
Python for All Python for All
Python for All
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
 
Python basics
Python basicsPython basics
Python basics
 
An Introduction to Python Programming
An Introduction to Python ProgrammingAn Introduction to Python Programming
An Introduction to Python Programming
 
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
 
Most Asked Python Interview Questions
Most Asked Python Interview QuestionsMost Asked Python Interview Questions
Most Asked Python Interview Questions
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Type hints in python & mypy
Type hints in python & mypyType hints in python & mypy
Type hints in python & mypy
 
Intro to python
Intro to pythonIntro to python
Intro to python
 
Java Basics
Java BasicsJava Basics
Java Basics
 
The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202
 
Python
PythonPython
Python
 
An Introduction to ANTLR
An Introduction to ANTLRAn Introduction to ANTLR
An Introduction to ANTLR
 

Similar to Summer Training Project On Python Programming

Python for katana
Python for katanaPython for katana
Python for katana
kedar nath
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
Vinay Chowdary
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
UttamKumar617567
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
Excellence Academy
 
Programming in Scala - Lecture One
Programming in Scala - Lecture OneProgramming in Scala - Lecture One
Programming in Scala - Lecture One
Angelo Corsaro
 
Python Programming 1.pptx
Python Programming 1.pptxPython Programming 1.pptx
Python Programming 1.pptx
Francis Densil Raj
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
Chariza Pladin
 
Python-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptxPython-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptx
dmdHaneef
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Shubham Yadav
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
 
Introduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and PythonIntroduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and Python
Jen Stirrup
 
Python
PythonPython
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_python
gunanandJha2
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.ppt
MohitChaudhary637683
 
Introduction to python lecture (1)
Introduction to python lecture (1)Introduction to python lecture (1)
Introduction to python lecture (1)
Ali ٍSattar
 
Shivam PPT.pptx
Shivam PPT.pptxShivam PPT.pptx
Shivam PPT.pptx
ShivamDenge
 
bhaskars.pptx
bhaskars.pptxbhaskars.pptx
bhaskars.pptx
NaveenShankar34
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
RohitKumar639388
 
Government Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxGovernment Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptx
ShivamDenge
 

Similar to Summer Training Project On Python Programming (20)

Python for katana
Python for katanaPython for katana
Python for katana
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Programming in Scala - Lecture One
Programming in Scala - Lecture OneProgramming in Scala - Lecture One
Programming in Scala - Lecture One
 
Python Programming 1.pptx
Python Programming 1.pptxPython Programming 1.pptx
Python Programming 1.pptx
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
Python-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptxPython-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptx
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
Introduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and PythonIntroduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and Python
 
Python
PythonPython
Python
 
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_python
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.ppt
 
Introduction to python lecture (1)
Introduction to python lecture (1)Introduction to python lecture (1)
Introduction to python lecture (1)
 
Shivam PPT.pptx
Shivam PPT.pptxShivam PPT.pptx
Shivam PPT.pptx
 
bhaskars.pptx
bhaskars.pptxbhaskars.pptx
bhaskars.pptx
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Government Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxGovernment Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptx
 

More from KAUSHAL KUMAR JHA

Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
KAUSHAL KUMAR JHA
 
Summer Training Project On Python Programming
Summer Training Project On Python ProgrammingSummer Training Project On Python Programming
Summer Training Project On Python Programming
KAUSHAL KUMAR JHA
 
Summer Training Project On Data Structure & Algorithms
Summer Training Project On Data Structure & AlgorithmsSummer Training Project On Data Structure & Algorithms
Summer Training Project On Data Structure & Algorithms
KAUSHAL KUMAR JHA
 
Python project on Image Based Captcha
Python project on Image Based CaptchaPython project on Image Based Captcha
Python project on Image Based Captcha
KAUSHAL KUMAR JHA
 
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
KAUSHAL KUMAR JHA
 
Black hole facts
Black hole factsBlack hole facts
Black hole facts
KAUSHAL KUMAR JHA
 

More from KAUSHAL KUMAR JHA (6)

Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
 
Summer Training Project On Python Programming
Summer Training Project On Python ProgrammingSummer Training Project On Python Programming
Summer Training Project On Python Programming
 
Summer Training Project On Data Structure & Algorithms
Summer Training Project On Data Structure & AlgorithmsSummer Training Project On Data Structure & Algorithms
Summer Training Project On Data Structure & Algorithms
 
Python project on Image Based Captcha
Python project on Image Based CaptchaPython project on Image Based Captcha
Python project on Image Based Captcha
 
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
 
Black hole facts
Black hole factsBlack hole facts
Black hole facts
 

Recently uploaded

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 

Recently uploaded (20)

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 

Summer Training Project On Python Programming

  • 1. FABRIKAM OOP USING PYTHON BY E-BOX S U M M E R T R A I N I N G K A U S H A L K U M A R J H A 1 1 8 0 2 1 6 9 C S E 3 4 3
  • 2. FABRIKAM Python is a widely used general-purpose, high level programming language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. Python is a great programming language that supports OOP. You will use it to define a class with attributes and methods, which you will then call. Python is a dynamic language, with high-level data types. This means that development happens much faster than with Java or C++. Python does not require the programmer to declare types of variables and arguments. This also makes Python easier to understand and learn for beginners, its code being more readable and intuitive. INTRODUCTION OF COURSE 2
  • 3. FABRIKAM REASON FOR CHOOSING THIS TECHNOLOGY 3 Python developers has a lot of scope in IT industries. Python is also a great language for those who want to build their career in Data Science, AI or Machine Learning field. There is wide scope and huge job opportunities for python programmers in India. Python is one of the most versatile and powerful programming languages. There is an extensive use of python programming language for both start-ups and corporate Python is popular for providing wide range of functionalities and applications and various packages and libraries, and hence making it easy to learn by newbies. Python supports Multiple Programming Paradigms. It has large set of library and tools. It has a vast community support. Python is designed for better code readability. It contains fewer lines of codes. It is an open source, general purpose, and object-oriented programming language.
  • 4. FABRIKAMFABRIKAM TOPICS COVERED • INTRODUCTION TO PYTHON • CLASSES AND OBJECTS • INHERITANCE • ABSTRACT CLASS AND INTERFACE • STRING/LIST AND DICTIONARY • EXCEPTION • MULTITHREADING • STREAMS • LAMBDA • DB CONNECTION • POLYMORPHISM • ENCAPSULATION AND ABSTRACTION 4
  • 5. FABRIKAM CLASSES AND OBJECTS 5 • Class: A class is a collection of objects or you can say it is a blueprint of objects defining the common attributes and behavior. Class is defined under a “Class” Keyword. Example: class class1(): // class 1 is the name of the class • Object: Objects are an instance of a class. It is an entity that has state and behavior. In a nutshell, it is an instance of a class that can access the data. Syntax: obj = class1() Here obj is the “object” of class1.
  • 6. FABRIKAM Inheritance allows us to define a class that inherits all the methods and properties from another class. Parent class is the class being inherited from, also called base class. Child class is the class that inherits from another class, also called derived class. Types of Inheritance depends upon the number of child and parent classes involved. There are four types of inheritance in Python: Single Inheritance: INHERITANCE 6
  • 8. FABRIKAM An abstract class can be considered as a blueprint for other classes. It allows you to create a set of methods that must be created within any child classes built from the abstract class. A class which contains one or more abstract methods is called an abstract class. An abstract method is a method that has a declaration but does not have an implementation. While we are designing large functional units we use an abstract class. When we want to provide a common interface for different implementations of a component, we use an abstract class. ABSTRACT CLASSES 8
  • 9. FABRIKAM Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters. However, Python does not have a character data type, a single character is simply a string with a length of 1. Square brackets can be used to access elements of the string. String Length: To get the length of a string, use the len() function. String Methods: Python has a set of built-in methods that we can use on strings. • The lower() method returns the string in lower case. • The upper() method returns the string in upper case. • The replace() method replaces a string with another string. • The strip() method removes any whitespace from the beginning or the end. STRINGS 9
  • 10. FABRIKAM LISTS 10 List in Python are ordered and have definite count. The elements in a list are indexed according to a definite sequence and the indexing of a list is done with 0 being the first index. Each element in the list has its definite place in the list, which allows duplicating of elements in the list, with each element having its own distinct place and credibility Creating a list: Lists in Python can be created by just placing the sequence inside the square brackets[]. Unlike Sets, list doesn’t need a built-in function for creation of list.
  • 11. FABRIKAM Dictionary in Python is an unordered collection of data values, used to store data values like a map, which unlike other Data Types that hold only single value as an element, Dictionary holds key:value pair. Key value is provided in the dictionary to make it more optimized. Creating a dictionary: In Python, a Dictionary can be created by placing sequence of elements within curly {} braces, separated by ‘comma’. Dictionary holds a pair of values, one being the Key and the other corresponding pair element being its key: value. Values in a dictionary can be of any datatype and can be duplicated, whereas keys can’t be repeated and must be immutable. Accessing Values: We can access the items of a dictionary by referring to its key name, inside square brackets. Built-In Functions: • cmp(dict1,dict2) • len(dict) • type(variable) DICTIONARY 11
  • 12. FABRIKAM An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's instructions. In general, when a Python script encounters a situation that it cannot cope with, it raises an exception. An exception is a Python object that represents an error. When a Python script raises an exception, it must either handle the exception immediately otherwise it terminates and quits. Handling an exception: If we have some suspicious code that may raise an exception, we can defend your program by placing the suspicious code in a try: block. After the try: block, include an except: statement, followed by a block of code which handles the problem as elegantly as possible. EXCEPTION 12
  • 13. FABRIKAM A thread is the smallest unit of processing that can be performed in an OS. Multithreading is defined as the ability of a processor to execute multiple threads concurrently. There are two kinds of threads: 1) Kernel threads 2) User-space threads or user threads Advantages of Threading: • Multithreaded programs can run faster on computer systems with multiple CPUs, because theses threads can be executed truly concurrent. • A program can remain responsive to input. This is true both on single and on multiple CPU • Threads of a process can share the memory of global variables. If a global variable is changed in one thread, this change is valid for all threads. A thread can have local variables. MULTITHREADING 13
  • 14. FABRIKAM StremReader: wraps or contain a stream StreamReader defines: read and other respective methods to read the data from the stream and ‘decode’ them. stream must be a file-like object open for reading(binary) data. StreamReader(stream[,errors]) - Constructor for a StreamReader instance. The StreamReader implement different error handling schemes by providing the errors keyword argument. These parameters are defined: • ‘strict’ raise ValueError (or a subclass); this is the default. • ‘ignore’ Ignore the character and continue with the next. • ‘replace’ Replace with a suitable replacement character. STREAMS 14
  • 15. FABRIKAM • A lambda function is a small anonymous function. • A lambda function can take any number of arguments, but can only have one expression. Syntax: lambda arguments : expression Example Add 10 to argument a, and return the result: x= lambda a : a+10 print(x(5)) Output: 15 LAMBDA 15
  • 16. FABRIKAM The Python programming language has powerful features for database programming. Python supports various databases like MySQL, Oracle, Sybase, PostgreSQL, etc. Python also supports Data Definition Language (DDL), Data Manipulation Language (DML) and Data Query Statements. For database programming, the Python DB API is a widely used module that provides a database application programming interface. There are many good reasons to use Python for programming database applications: • Programming in Python is arguably more efficient and faster compared to other languages. • Python is famous for its portability. • It is platform independent. • Python supports SQL cursors. DB CONNECTION 16
  • 17. FABRIKAM LEARNING OUTCOMES  Mastered the fundamentals of writing Python scripts  Learned core Python scripting elements such as variables and flow control structures  Discovered how to work with lists and sequence data  Write Python functions to facilitate code reuse  Use Python to read and write files  Make their code robust by handling errors and exceptions properly  Work with the Python standard library  Learned to acquire Object Oriented Skills in Python 17