SlideShare a Scribd company logo
Python Basics
Python Basics
Introduction to Python
● Python is an interpreted, object-oriented, high-level programming
language with dynamic semantics. It was created by Guido van
Rossum, and released in 1991.
● Python is the most popular programming language because of its
simplicity, powerful libraries, and readability. Python has a simple
syntax, is readable, and has great community support.
Python
Python Basics
Introduction to Python
● Python is the very first step in many new age technologies like Machine
Learning, Data Science, Deep Learning and Artificial Intelligence.
However It is also used in Web Development, Game Development,
Desktop GUI, Web Scraping Applications, Business Applications ,cad
Applications, Embedded Applications etc.
Python
Python Basics
Python Data Type
● Python has following standard or built in data type
○ Numeric
■ Int
■ Float
■ Complex number
○ Boolean
○ Sequence Type
■ String
■ List
■ Tuple
○ Dictionary
Python Basics
Python Data Type
● Python has built in function type() to ascertain the data type of
certain value.
Numeric Data Type
● Integer
○ It includes zero, positive, negative whole numbers having
unlimited precision(number of digit in number) without any
fractional part.
Python Basics
Python Data Type
● Float
○ It includes any real numbers with floating point representation.
And fractional part is denoted by decimal symbol or scientific
notation.
● Boolean
○ It includes data with two built-in values “True” or “False”. Here
“T” and “F” must be in capital letter. In python true and false are
invalid boolean and python will throw error for that.
Python Basics
Python Data Type
Dictionary
● In python, a dictionary is similar to hash or maps in other languages.
It consists of key value pairs. The value can be accessed by a unique
key in the dictionary.In Python dictionaries are written with curly
brackets
● Dictionary is a collection which is unordered, changeable and
indexed. No duplicate members.
● Syntax- dict = { key1:value1, key2:value2,...keyN:valueN }
Python Basics
Python Data Type
Sequence Type
● A sequence is ordered collection of similar or different data type.
● String
○ A string value is collection of one or more characters.It is
defined in single,double or triple quotes
○ String is a object of python’s built in class ‘str’.
Python Basics
Python Data Type
● List
○ Lists are used to store data of different data types in a sequential
manner.List is a collection which is ordered and changeable.
Allows duplicate members.In Python lists are written with
square brackets.
○ There are addresses assigned to every element of the list, which
is called an Index. The index value starts from 0 and goes on
until the last element called the positive index. There is also
negative indexing which starts from -1 enabling you to access
elements from the last to first.
Python Basics
Python Data Type
● Tuple
A tuple is a collection which is ordered and unchangeable.
Python tuples work exactly like Python lists except they are
immutable, i.e. they can’t be changed in place.
In Python tuples are written with round brackets.
Python Basics
Python Data Type
Python Basics
Operators
● Python has following operators.
○ Arithmetic operators
○ Assignment operators
○ Comparison operators
○ Logical operators
○ Identity operators
○ Membership operators
○ Bitwise operators
Python Basics
Operators
● Arithmetic operators
.
Arithmetic Operators
Python Basics
Operators
● Assignment operators
● Assignment operators assign values to variables.
.
Assignment
operators
Python Basics
Operators
● Comparison Operators
● Comparison operators used to compare values
two values.
.
Comparison Operators
Python Basics
Operators
● Logical Operators
● Logical operator are used to combine
statement .
.
Logical Operators
Python Basics
Operators
● Identity Operators
● Identity operators are used to compare
the objects, not if they are equal, but if they
are actually the same object, with the
same memory location
Identity Operator
Python Basics
Operators
● Membership Operators
● Membership operators are used to test if a
sequence is presented in an object
.
Membership Operators
Python Basics
Operators
● Bitwise Operators
● Bitwise operators are used
to compare (binary) numbers
.
Bitwise Operators
Python Basics
Code Block
● If-else
○ Syntax
■ if (condition):
# Executes this block if
# condition is true
else:
# Executes this block if
# condition is false
Python Basics
Code Block
● while
○ Syntax
■ while expression:
statement(s)
.
Python Basics
Code Block
● For loop
○ Syntax
■ for val in sequence:
Body of for
.
Python Basics
Functions
.
● There are two types of functions in python.
(1)User Defined Functions
(2)Built-In Functions
● User defined function
○ We can use def keyword to declare the function and followed by
the function name and parentheses(())
User defined Function
Python Basics
Functions
● Any input parameters or arguments should be placed within these
parenthesis. We can can also define parameters inside these
parentheses.
● The code block within every function starts with a colon (:) and is
indented.
● The statement return [expression] exits a function, optionally passing
back an expression to the caller. A return statement with no
arguments is the same as return None.
● We can call the function by function name followed by parenthesis.
Python Basics
Functions
● Built-In function
○ The Python built-in functions are
defined as the functions whose
functionality is pre-defined in
Python.
○ Python provides many built-in
functions.
Python Basics
Functions
● Built-In function
● Some examples:
Python Basics
Packages
● A Python package refers to a directory of Python module(s).Python
package is basically a directory with python files and a file with the
name with init.py.
● Steps For creating and importing package in Python:
○ Create a new folder with any name.Example: G:My_App
○ Inside this folder create subfolder with any name:Example:
G:My_Appmypackage
○ Create an empty __init__.py file in the mypackage(subfolder)
folder.
Python Basics
Packages
● __init__.py serves two purposes.
● The Python interpreter recognizes a folder as the package if it
contains __init__.py file.
● __init__.py exposes specified resources from its modules to be
imported.
● Using any python editor create any modules.Example:
Python Basics
File handling
● The key function of python to working with file is open() function.
● We can open file as follow.
● Here the first argument is file path.And second argument is mode.the
common value for mode is “r” for reading,”w” for writing and “a”
for appending..
○ Here file1 is file object.It is use for to obtain information about
file.
Python Basics
File handling
● We have to always close the file object using the method close.
● We can use name attribute to get name and mode attribute to get
mode of file.
Python Basics
File handling
● We can use readline() method to read first line of the file.If we use
readline() method second time then it read second time and so on.We can
read the number of character that we want to read by passing the parameter
to readline() method.
Python Basics
File handling
● We can use read() to read whole file.
● If we use open method to read the file we have to every time close the
file.So we can use another method that automatically close our file.
Python Basics
File handling
● We can write in file by opening a file in write mode and using write
method to write content in the file.
● If we use “w” mode then it will delete all the previous data and then
write the content in the file.
● But with append “a” mode we can add our content to previously
written content of file.
Python Basics
Classes
● In python a class definition begin with class
● keyword.Syntax for declaring class.
● Class with object and method
● In python a class must have one extra parameter
● (self) in method definition.It is same as pointer in
c++ and reference in java.
Python Basics
Classes
● __init__ method
○ This method is similar to constructor in java and c++.This
method is useful to do any any initialization that we want to do
with our object.
○ Example
Python Basics
Numpy
● NumPy is a python library used for working with arrays.
● It also has functions for working in the domain of linear
algebra,fourier transform, and matrices.
● We can install a library using the following command. :”pip install
numpy”
Python Basics
Numpy
● To use numpy we have to import numpy library as follows.
● Numpy contains a large number of various mathematical
operations.Numpy provides standard trigonometric
functions,functions for arithmetic operations,handling complex
numbers etc.
Python Basics
Numpy
● We can initialize numpy arrays from nested Python lists, and access
elements using square brackets:
We can perform
various
mathematical
operation.
Python Basics
Plotting
● We can use many libraries of to plot data like matplotlib,seaborn,ggplot etc.
● Matplotlib
● Matplotlib.pyplot is a plotting library used for
2D graphics in python programming language.
● It can be used in python scripts,shell,web application
servers and other graphical user interface toolkits.
● The most important function in matplotlib is plot,
which allows us to plot 2D data.
Here is a simple example:
Python Basics
Plotting
We can plot
different
things in the
same figure
using the
subplot
function.
Here are
some
example:
Python Basics
Plotting
● seaborn
● The Python seaborn library is used to ease the
challenging task of data visualization and it is
based on Matplotlib.
● It provides a high-level interface for drawing
attractive and informative statistical graphics.
● The main idea of Seaborn is that it provides
high-level commands to create a variety of plot
types useful for statistical data exploration,
and even some statistical model fitting.
● As like matplotlib, seaborn provides various plot to visualize the
data.
Python Basics
Plotting
Thank You!!!

More Related Content

What's hot

Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
Mohammed Sikander
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
AbhayDhupar
 
Python Exception Handling
Python Exception HandlingPython Exception Handling
Python Exception Handling
Megha V
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Edureka!
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Python basics
Python basicsPython basics
Python basics
Jyoti shukla
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
Samir Mohanty
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Ayshwarya Baburam
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
Elewayte
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
Dipankar Achinta
 
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
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
amiable_indian
 
Python programming
Python  programmingPython  programming
Python programming
Ashwin Kumar Ramasamy
 
Python final ppt
Python final pptPython final ppt
Python final ppt
Ripal Ranpara
 
Basics of python
Basics of pythonBasics of python
Basics of python
SurjeetSinghSurjeetS
 
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
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
Srinivas Narasegouda
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
Haitham El-Ghareeb
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Edureka!
 

What's hot (20)

Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Python Exception Handling
Python Exception HandlingPython Exception Handling
Python Exception Handling
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
Python basics
Python basicsPython basics
Python basics
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Python programming
Python  programmingPython  programming
Python programming
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
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
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
 

Similar to Introduction to Python programming Language

Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
jaba kumar
 
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development EnvironmentPython Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Devloper
 
Python intro
Python introPython intro
Python intro
Piyush rai
 
Python 01.pptx
Python 01.pptxPython 01.pptx
Python 01.pptx
AliMohammadAmiri
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
Asst.prof M.Gokilavani
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
JosephMuez2
 
intro to python.pptx
intro to python.pptxintro to python.pptx
intro to python.pptx
UpasnaSharma37
 
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-Basics.pptx
Python-Basics.pptxPython-Basics.pptx
Python-Basics.pptx
TamalSengupta8
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Shubham Yadav
 
Python assignment help from professional programmers
Python assignment help from professional programmersPython assignment help from professional programmers
Python assignment help from professional programmers
Anderson Silva
 
Python for katana
Python for katanaPython for katana
Python for katana
kedar nath
 
Python_Unit_1.pdf
Python_Unit_1.pdfPython_Unit_1.pdf
Python_Unit_1.pdf
alaparthi
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
RojaPriya
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
kavinilavuG
 
Artificial Intelligence concepts in a Nutshell
Artificial Intelligence concepts in a NutshellArtificial Intelligence concepts in a Nutshell
Artificial Intelligence concepts in a Nutshell
kannanalagu1
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
zynofustechnology
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
Python Programming.pptx
Python Programming.pptxPython Programming.pptx
Python Programming.pptx
DineshThakur911173
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
Vinay Chowdary
 

Similar to Introduction to Python programming Language (20)

Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
 
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development EnvironmentPython Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
 
Python intro
Python introPython intro
Python intro
 
Python 01.pptx
Python 01.pptxPython 01.pptx
Python 01.pptx
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
 
intro to python.pptx
intro to python.pptxintro to python.pptx
intro 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-Basics.pptx
Python-Basics.pptxPython-Basics.pptx
Python-Basics.pptx
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
 
Python assignment help from professional programmers
Python assignment help from professional programmersPython assignment help from professional programmers
Python assignment help from professional programmers
 
Python for katana
Python for katanaPython for katana
Python for katana
 
Python_Unit_1.pdf
Python_Unit_1.pdfPython_Unit_1.pdf
Python_Unit_1.pdf
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Artificial Intelligence concepts in a Nutshell
Artificial Intelligence concepts in a NutshellArtificial Intelligence concepts in a Nutshell
Artificial Intelligence concepts in a Nutshell
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
Python Programming.pptx
Python Programming.pptxPython Programming.pptx
Python Programming.pptx
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
 

Recently uploaded

CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
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
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 

Recently uploaded (20)

CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
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...
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 

Introduction to Python programming Language

  • 2. Python Basics Introduction to Python ● Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. It was created by Guido van Rossum, and released in 1991. ● Python is the most popular programming language because of its simplicity, powerful libraries, and readability. Python has a simple syntax, is readable, and has great community support. Python
  • 3. Python Basics Introduction to Python ● Python is the very first step in many new age technologies like Machine Learning, Data Science, Deep Learning and Artificial Intelligence. However It is also used in Web Development, Game Development, Desktop GUI, Web Scraping Applications, Business Applications ,cad Applications, Embedded Applications etc. Python
  • 4. Python Basics Python Data Type ● Python has following standard or built in data type ○ Numeric ■ Int ■ Float ■ Complex number ○ Boolean ○ Sequence Type ■ String ■ List ■ Tuple ○ Dictionary
  • 5. Python Basics Python Data Type ● Python has built in function type() to ascertain the data type of certain value. Numeric Data Type ● Integer ○ It includes zero, positive, negative whole numbers having unlimited precision(number of digit in number) without any fractional part.
  • 6. Python Basics Python Data Type ● Float ○ It includes any real numbers with floating point representation. And fractional part is denoted by decimal symbol or scientific notation. ● Boolean ○ It includes data with two built-in values “True” or “False”. Here “T” and “F” must be in capital letter. In python true and false are invalid boolean and python will throw error for that.
  • 7. Python Basics Python Data Type Dictionary ● In python, a dictionary is similar to hash or maps in other languages. It consists of key value pairs. The value can be accessed by a unique key in the dictionary.In Python dictionaries are written with curly brackets ● Dictionary is a collection which is unordered, changeable and indexed. No duplicate members. ● Syntax- dict = { key1:value1, key2:value2,...keyN:valueN }
  • 8. Python Basics Python Data Type Sequence Type ● A sequence is ordered collection of similar or different data type. ● String ○ A string value is collection of one or more characters.It is defined in single,double or triple quotes ○ String is a object of python’s built in class ‘str’.
  • 9. Python Basics Python Data Type ● List ○ Lists are used to store data of different data types in a sequential manner.List is a collection which is ordered and changeable. Allows duplicate members.In Python lists are written with square brackets. ○ There are addresses assigned to every element of the list, which is called an Index. The index value starts from 0 and goes on until the last element called the positive index. There is also negative indexing which starts from -1 enabling you to access elements from the last to first.
  • 10. Python Basics Python Data Type ● Tuple A tuple is a collection which is ordered and unchangeable. Python tuples work exactly like Python lists except they are immutable, i.e. they can’t be changed in place. In Python tuples are written with round brackets.
  • 12. Python Basics Operators ● Python has following operators. ○ Arithmetic operators ○ Assignment operators ○ Comparison operators ○ Logical operators ○ Identity operators ○ Membership operators ○ Bitwise operators
  • 13. Python Basics Operators ● Arithmetic operators . Arithmetic Operators
  • 14. Python Basics Operators ● Assignment operators ● Assignment operators assign values to variables. . Assignment operators
  • 15. Python Basics Operators ● Comparison Operators ● Comparison operators used to compare values two values. . Comparison Operators
  • 16. Python Basics Operators ● Logical Operators ● Logical operator are used to combine statement . . Logical Operators
  • 17. Python Basics Operators ● Identity Operators ● Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location Identity Operator
  • 18. Python Basics Operators ● Membership Operators ● Membership operators are used to test if a sequence is presented in an object . Membership Operators
  • 19. Python Basics Operators ● Bitwise Operators ● Bitwise operators are used to compare (binary) numbers . Bitwise Operators
  • 20. Python Basics Code Block ● If-else ○ Syntax ■ if (condition): # Executes this block if # condition is true else: # Executes this block if # condition is false
  • 21. Python Basics Code Block ● while ○ Syntax ■ while expression: statement(s) .
  • 22. Python Basics Code Block ● For loop ○ Syntax ■ for val in sequence: Body of for .
  • 23. Python Basics Functions . ● There are two types of functions in python. (1)User Defined Functions (2)Built-In Functions ● User defined function ○ We can use def keyword to declare the function and followed by the function name and parentheses(()) User defined Function
  • 24. Python Basics Functions ● Any input parameters or arguments should be placed within these parenthesis. We can can also define parameters inside these parentheses. ● The code block within every function starts with a colon (:) and is indented. ● The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return None. ● We can call the function by function name followed by parenthesis.
  • 25. Python Basics Functions ● Built-In function ○ The Python built-in functions are defined as the functions whose functionality is pre-defined in Python. ○ Python provides many built-in functions.
  • 26. Python Basics Functions ● Built-In function ● Some examples:
  • 27. Python Basics Packages ● A Python package refers to a directory of Python module(s).Python package is basically a directory with python files and a file with the name with init.py. ● Steps For creating and importing package in Python: ○ Create a new folder with any name.Example: G:My_App ○ Inside this folder create subfolder with any name:Example: G:My_Appmypackage ○ Create an empty __init__.py file in the mypackage(subfolder) folder.
  • 28. Python Basics Packages ● __init__.py serves two purposes. ● The Python interpreter recognizes a folder as the package if it contains __init__.py file. ● __init__.py exposes specified resources from its modules to be imported. ● Using any python editor create any modules.Example:
  • 29. Python Basics File handling ● The key function of python to working with file is open() function. ● We can open file as follow. ● Here the first argument is file path.And second argument is mode.the common value for mode is “r” for reading,”w” for writing and “a” for appending.. ○ Here file1 is file object.It is use for to obtain information about file.
  • 30. Python Basics File handling ● We have to always close the file object using the method close. ● We can use name attribute to get name and mode attribute to get mode of file.
  • 31. Python Basics File handling ● We can use readline() method to read first line of the file.If we use readline() method second time then it read second time and so on.We can read the number of character that we want to read by passing the parameter to readline() method.
  • 32. Python Basics File handling ● We can use read() to read whole file. ● If we use open method to read the file we have to every time close the file.So we can use another method that automatically close our file.
  • 33. Python Basics File handling ● We can write in file by opening a file in write mode and using write method to write content in the file. ● If we use “w” mode then it will delete all the previous data and then write the content in the file. ● But with append “a” mode we can add our content to previously written content of file.
  • 34. Python Basics Classes ● In python a class definition begin with class ● keyword.Syntax for declaring class. ● Class with object and method ● In python a class must have one extra parameter ● (self) in method definition.It is same as pointer in c++ and reference in java.
  • 35. Python Basics Classes ● __init__ method ○ This method is similar to constructor in java and c++.This method is useful to do any any initialization that we want to do with our object. ○ Example
  • 36. Python Basics Numpy ● NumPy is a python library used for working with arrays. ● It also has functions for working in the domain of linear algebra,fourier transform, and matrices. ● We can install a library using the following command. :”pip install numpy”
  • 37. Python Basics Numpy ● To use numpy we have to import numpy library as follows. ● Numpy contains a large number of various mathematical operations.Numpy provides standard trigonometric functions,functions for arithmetic operations,handling complex numbers etc.
  • 38. Python Basics Numpy ● We can initialize numpy arrays from nested Python lists, and access elements using square brackets: We can perform various mathematical operation.
  • 39. Python Basics Plotting ● We can use many libraries of to plot data like matplotlib,seaborn,ggplot etc. ● Matplotlib ● Matplotlib.pyplot is a plotting library used for 2D graphics in python programming language. ● It can be used in python scripts,shell,web application servers and other graphical user interface toolkits. ● The most important function in matplotlib is plot, which allows us to plot 2D data. Here is a simple example:
  • 40. Python Basics Plotting We can plot different things in the same figure using the subplot function. Here are some example:
  • 41. Python Basics Plotting ● seaborn ● The Python seaborn library is used to ease the challenging task of data visualization and it is based on Matplotlib. ● It provides a high-level interface for drawing attractive and informative statistical graphics. ● The main idea of Seaborn is that it provides high-level commands to create a variety of plot types useful for statistical data exploration, and even some statistical model fitting. ● As like matplotlib, seaborn provides various plot to visualize the data.