SlideShare a Scribd company logo
Dr. A. B. Shinde
Assistant Professor,
Electronics and Computer Science,
P V P Institute of Technology, Sangli
Introduction to Python
Dr. A. B. Shinde
Contents…
• Introduction:
• History of Python,
• Need of Python,
• Features of Python,
• Comparison with C and Java,
• Python Building Blocks:
– Keywords, Identifiers,
– Variables, Comments, Docstring,
– Indentation, Input-Output.
• Python Installation:
• Python Installation with 3.x version, Working with various IDE:
• Command Prompt, IDLE, Jupyter Notebook, Google Colab, Pycharm,
VS Code, Spyder.
2
Python History
Dr. A. B. Shinde
Dr. A. B. Shinde
Python History 4
 Python is a widely used general-purpose, high-level programming
language.
 It was initially designed by Guido Van Rossum in 1991 and developed
by Python Software Foundation.
 It was mainly developed to emphasize code readability, and its syntax
allows programmers to express concepts in fewer lines of code.
Dr. A. B. Shinde
Python History 5
 In the late 1980s, working on Python started.
 Soon after that, Guido Van Rossum began doing its application-based
work in December of 1989 at Centrum Wiskunde & Informatica (CWI)
which is situated in the Netherlands.
 It was started as a hobby project because he was looking for an
interesting project to keep him occupied during Christmas.
Why Python ???
Dr. A. B. Shinde
Dr. A. B. Shinde
What is Python? 7
 Python is a high-level programming language celebrated for its
simplicity, readability, and versatility.
 Python supports multiple programming paradigms and boosts an
extensive standard library that simplifies coding tasks.
 Its large ecosystem of third-party libraries and frameworks further
enhances its capabilities, making it a top choice for web development,
scientific computing, data analysis, artificial intelligence, machine
learning, and automation.
 Python’s clear syntax and strong community support contribute to its
popularity among beginners and experienced developers.
Dr. A. B. Shinde
Why Python? 8
Data Science
• Python is the preferred programming language of most data scientists.
• With the release of NumPy and Pandas, Python rose to prominence in
the world of data.
• Python also handles statistical, tabular and matrix data and also
visualizes it with libraries like Matplotlib and Seaborn.
Easy to Learn
• Python’s resemblance to the English language makes it easy to master.
• Python’s syntax is characterized by very few rules and special cases.
• Another attractive aspect of this programming language is its efficiency
and readability.
Dr. A. B. Shinde
Why Python? 9
Cross-Platform and Open Source
• It’s been more than 20 years since this language has been running
cross-platform and open source.
• Be it Linux, Windows or MacOS, Python code works on every platform.
Vast Libraries
• Python is supported by PyPI which has 85,000+ python scripts and
modules accessible to the user.
• These modules provide pre-packaged functionality available to the
users in their local Python environment.
Dr. A. B. Shinde
Why Python? 10
Benefits of using Python
• Readability: Python’s syntax is designed to be easily readable, making
it easier to write and maintain code.
• Easy to learn and use: Python’s simple syntax makes it beginner-
friendly
• Extensive libraries and frameworks: Offers rich libraries for web
development, data science, AI, etc.​
• Versatile: Supports multiple programming paradigms and applications​
• Cross-platform: Works seamlessly across Windows, macOS, and
Linux​
• Great for rapid prototyping: Quick syntax allows for fast idea
implementation
Features of Python
Dr. A. B. Shinde
Dr. A. B. Shinde
Features of Python 12
1. Free and Open Source
• Python language is freely available at the official website.
• It is open-source, this means that source code is also available to the
public.
2. Easy to code
• Python is very easy to learn as compared to other languages like C, C#,
Javascript, Java, etc.
• It is also a developer-friendly language.
3. Easy to Read
• Python’s syntax are straightforward.
• It makes the code more readable.
Dr. A. B. Shinde
Features of Python 13
4. Object-Oriented Language
• Python supports object-oriented language and concepts of classes,
object encapsulation, etc.
5. GUI Programming Support
• Graphical User interfaces can be made using a module such as PyQt5,
wxPython, or Tk in Python. PyQt5 is the most popular option for
creating graphical apps with Python.
6. High-Level Language
• Python is a high-level language.
7. Large Community Support
• Questions are constantly answered by the community.
Dr. A. B. Shinde
Features of Python 14
8. Easy to Debug
• Excellent for mistake tracing. You will be able to quickly identify and
correct the majority of your program’s issues once you understand how
to interpret Python’s error traces.
9. Python is a Portable language
• Python language is also a portable language, we can run python code
on any platform.
• Python code written for Windows can run on other platforms such
as Linux, Unix, and Mac then we do not need to change it,
10. Python is an Integrated language
• Python is also an Integrated language because we can easily integrate
Python with other languages like C, C++, etc.
Dr. A. B. Shinde
Features of Python 15
11. Interpreted Language:
• Python is an Interpreted Language because Python code is executed
line by line at a time.
• There is no need to compile Python code this makes it easier to debug
our code.
12. Large Standard Library
• Python has a large standard library that provides a rich set of modules
and functions
13. Dynamically Typed Language
• Python is a dynamically-typed language. That means the type (for
example- int, double, long, etc.) for a variable is decided at run time not
in advance because of this feature we don’t need to specify the type of
variable.
Dr. A. B. Shinde
Features of Python 16
14. Frontend and backend development
• With a new project py script, you can run and write Python codes in
HTML with the help of some simple tags <py-script>, <py-env>, etc.
• This will help you do frontend development work in Python like
javascript.
• Backend is the strong forte of Python it’s extensively used for this work
cause of its frameworks like Django and Flask.
15. Allocating Memory Dynamically
• In Python, the variable data type does not need to be specified.
• The memory is automatically allocated to a variable at runtime when it is
given a value.
Comparison with Other Languages
Dr. A. B. Shinde
Dr. A. B. Shinde
Comparison of Python 18
Feature Python C C++ Java
Type Interpreted Compiled Compiled
Compiled and
Interpreted
Paradigm
Multi-paradigm (object-
oriented, procedural,
functional)
Procedural, structured
Multi-paradigm
(procedural, object-
oriented, generic)
Object-oriented,
structured
Memory
Management
Automatic Manual Manual Automatic
Syntax Simple Complex Complex Complex
Use Cases
Web development,
data analysis, machine
learning
System programming,
embedded systems,
game development
System programming,
game development,
high-performance
applications
Large-scale
applications,
enterprise software
Notable
Frameworks/
Libraries
Django, Flask Standard Library
Standard Library,
Boost
Spring, Hibernate
Community
Support
Strong Strong Strong Strong
Dr. A. B. Shinde
Comparison of Python 19
 Python vs Java
For Example, Here is a code in Java
Same code written in Python
Python Building Blocks: Basics
Dr. A. B. Shinde
Dr. A. B. Shinde
Python Basics 21
 Python Syntax
 Syntax refers to the set of rules that defines how to write and organize
code so that the Python interpreter can understand and run it correctly.
 These rules ensure that your code is structured, formatted, and error-
free.
Dr. A. B. Shinde
Python Basics 22
 Python keywords
 Keywords are reserved words that have special meanings and serve
specific purposes in the language syntax.
 They cannot be used as identifiers (names for variables, functions,
classes, etc.).
 For instance, "for", "while", "if", and "else" are keywords and cannot be
used as identifiers.
alse await else import pa
one break except in raise
rue class finally is return
nd continue for lambda try
s def from nonlocal while
ssert del global not with
sync elif if or yield
Dr. A. B. Shinde
Python Basics 23
• Python Identifiers
• In identifiers are unique names that are assigned to variables,
functions, classes, and other entities.
• They are used to uniquely identify the entity within the program.
• They should start with a letter (a-z, A-Z) or an underscore "_" and can
be followed by letters, numbers, or underscores.
• In the below example "first_name" is an identifier that store string value.
first_name = "Ram"
Dr. A. B. Shinde
Python Basics 24
 Python Identifiers
• Identifier : some rules
• Identifiers can be composed of alphabets (either uppercase or
lowercase), numbers (0-9), and the underscore character (_).
• They shouldn't include any special characters or spaces.
• The starting character of an identifier must be an alphabet or an
underscore.
• Within a specific scope or namespace, each identifier should have a
distinct name to avoid conflicts.
A = 3.14
x = 3.14
Num = 3.14
Sagar = 3.14
Pi = 3.14
Dr. A. B. Shinde
Python Basics 25
• Python Variables
• Variables in Python are essentially named references pointing to objects
in memory.
• You don't need to declare a variable's type explicitly in Python. Based on
the value assigned, Python will dynamically determine the type.
• In the below example, variable 'a' is initialize with integer value and
variable 'b' with a string. Because of dynamic-types behavior, data type
will be decide during runtime.
Dr. A. B. Shinde
Python Basics 26
• Comments in Python
• Comments are used to explain, clarify, or give context about specific
parts of the code.
• The purpose of comments is to explain the working of a code, they have
no impact on the execution or outcome of a program.
• Python Single Line Comment
• Single line comments are preceded by the "#" symbol.
• Everything after this symbol on the same line is considered a comment.
Dr. A. B. Shinde
Python Basics 27
 Comments in Python
• Python Multi-line Comment
• Python doesn't have a specific syntax for multi-line comments.
• However, programmers often use multiple single-line comments, one
after the other, or sometimes triple quotes (either ''' or """), even though
they're technically string literals.
• Below is the example of multiline comment.
Dr. A. B. Shinde
Python Basics 28
• Multiple Line Statements
• Writing a long statement in a code is not feasible or readable.
• Breaking a long line of code into multiple lines makes is more readable.
• Using Backslashes ()
• In Python, you can break a statement into multiple lines using the
backslash ().
Dr. A. B. Shinde
Python Basics 29
• Continuation of Statements in Python
• Statements are typically written on a single line.
• There are scenarios where writing a statement on multiple lines can
improve readability or is required due to the length of the statement.
• Implicit Continuation
• Python implicitly supports line continuation within parentheses ( ),
square brackets [ ], and curly braces { }.
Dr. A. B. Shinde
Python Basics 30
• Continuation of Statements in Python
• Statements are typically written on a single line.
• There are scenarios where writing a statement on multiple lines can
improve readability or is required due to the length of the statement.
• Explicit Continuation
• You can use backslash '' to indicate that a statement should continue
on the next line.
Dr. A. B. Shinde
Python Basics 31
• Input from User in Python
• The input( ) function in Python is used to take user input from the
console.
• The program execution halts until the user provides input and presses
"Enter". The entered data is then returned as a string.
• Example: The user will see the message "Please enter your name: ".
• After entering their name and pressing "Enter", they'll receive a greeting
with the name they provided.
Dr. A. B. Shinde
Python Basics 32
• Input from User in Python
• Take Multiple Input in Python
• We are taking multiple inputs from the user in a single line, splitting the
values entered by the user into separate variables for each value using
the split( ) method.
• Then, it prints the values with corresponding labels, either two or three,
based on the number of inputs provided by the user
Dr. A. B. Shinde
Python Basics 33
• Input from User in Python
• Take Conditional Input from user
• The input is converted to an integer using the int() function.
• Then, the program uses conditional statements to check the age range
and prints a message based on whether the user is a minor, an adult, or
a senior citizen.
Dr. A. B. Shinde
Python Basics 34
 Output in Python:
• print( )
• print() function allows us to display text, variables and expressions on
the console.
• In this example, “SY ECS, PVPIT” is a string literal enclosed within
double quotes.
Dr. A. B. Shinde
Python Basics 35
 Output in Python:
• Printing Variables
• We can use the print( ) function to print single and multiple variables.
• We can print multiple variables by separating them with commas.
• Example:
Dr. A. B. Shinde
Python Basics 36
 Output in Python:
 Output Formatting
 Example: Using Format( )
Dr. A. B. Shinde
Python Basics 37
 Output in Python:
 Output Formatting
 Example: Using sep and end parameter
Dr. A. B. Shinde
Python Basics 38
 Output in Python:
 Output Formatting
 Example: Using f-string
This presentation is published only for educational purpose
Thank You…
abshinde.eln@gmail.com
Ad

More Related Content

Similar to Introduction to Python programming language (20)

Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
A Brief Introduction to Python - English
A Brief Introduction to Python - EnglishA Brief Introduction to Python - English
A Brief Introduction to Python - English
Devashish Negi
 
It is about IDLE Python Installation version 3.1.2
It is about IDLE Python Installation version 3.1.2It is about IDLE Python Installation version 3.1.2
It is about IDLE Python Installation version 3.1.2
swarajyakmit15
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
 
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
 
Module 1 Review of Python Basics An Introduction
Module 1 Review of Python Basics An IntroductionModule 1 Review of Python Basics An Introduction
Module 1 Review of Python Basics An Introduction
percivalfernandez2
 
Introduction-To-Python- a guide to master
Introduction-To-Python- a guide to masterIntroduction-To-Python- a guide to master
Introduction-To-Python- a guide to master
ImadM4
 
Python notes for beginners - in simple sentences
Python notes for beginners - in simple sentencesPython notes for beginners - in simple sentences
Python notes for beginners - in simple sentences
RajyalakshmiUmmadise
 
Research paper on python by Rj
Research paper on python by RjResearch paper on python by Rj
Research paper on python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Introduction to Python Programming Basics
Introduction  to  Python  Programming BasicsIntroduction  to  Python  Programming Basics
Introduction to Python Programming Basics
Dhana malar
 
Python Way of Program is a topic for beginners
Python Way of Program is a topic for beginnersPython Way of Program is a topic for beginners
Python Way of Program is a topic for beginners
riazahamed37
 
Python Way of Program is a topic for beginners
Python Way of Program is a topic for beginnersPython Way of Program is a topic for beginners
Python Way of Program is a topic for beginners
riazahamed37
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Gnanesh12
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech Pune
Ethan's Tech
 
Mastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions Demystified
MalcolmDupri
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
Vinay Chowdary
 
5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx
Attitude Tally Academy
 
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
A Brief Introduction to Python - English
A Brief Introduction to Python - EnglishA Brief Introduction to Python - English
A Brief Introduction to Python - English
Devashish Negi
 
It is about IDLE Python Installation version 3.1.2
It is about IDLE Python Installation version 3.1.2It is about IDLE Python Installation version 3.1.2
It is about IDLE Python Installation version 3.1.2
swarajyakmit15
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
 
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
 
Module 1 Review of Python Basics An Introduction
Module 1 Review of Python Basics An IntroductionModule 1 Review of Python Basics An Introduction
Module 1 Review of Python Basics An Introduction
percivalfernandez2
 
Introduction-To-Python- a guide to master
Introduction-To-Python- a guide to masterIntroduction-To-Python- a guide to master
Introduction-To-Python- a guide to master
ImadM4
 
Python notes for beginners - in simple sentences
Python notes for beginners - in simple sentencesPython notes for beginners - in simple sentences
Python notes for beginners - in simple sentences
RajyalakshmiUmmadise
 
Introduction to Python Programming Basics
Introduction  to  Python  Programming BasicsIntroduction  to  Python  Programming Basics
Introduction to Python Programming Basics
Dhana malar
 
Python Way of Program is a topic for beginners
Python Way of Program is a topic for beginnersPython Way of Program is a topic for beginners
Python Way of Program is a topic for beginners
riazahamed37
 
Python Way of Program is a topic for beginners
Python Way of Program is a topic for beginnersPython Way of Program is a topic for beginners
Python Way of Program is a topic for beginners
riazahamed37
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Gnanesh12
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech Pune
Ethan's Tech
 
Mastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions Demystified
MalcolmDupri
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
Vinay Chowdary
 
5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx
Attitude Tally Academy
 

More from Dr. A. B. Shinde (20)

Python Data Types, Operators and Control Flow
Python Data Types, Operators and Control FlowPython Data Types, Operators and Control Flow
Python Data Types, Operators and Control Flow
Dr. A. B. Shinde
 
Communication System Basics
Communication System BasicsCommunication System Basics
Communication System Basics
Dr. A. B. Shinde
 
MOSFETs: Single Stage IC Amplifier
MOSFETs: Single Stage IC AmplifierMOSFETs: Single Stage IC Amplifier
MOSFETs: Single Stage IC Amplifier
Dr. A. B. Shinde
 
MOSFETs
MOSFETsMOSFETs
MOSFETs
Dr. A. B. Shinde
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: Basics
Dr. A. B. Shinde
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
Dr. A. B. Shinde
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
Dr. A. B. Shinde
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
Dr. A. B. Shinde
 
Resume Format
Resume FormatResume Format
Resume Format
Dr. A. B. Shinde
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
Dr. A. B. Shinde
 
Resume Writing
Resume WritingResume Writing
Resume Writing
Dr. A. B. Shinde
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing Basics
Dr. A. B. Shinde
 
Blooms Taxonomy in Engineering Education
Blooms Taxonomy in Engineering EducationBlooms Taxonomy in Engineering Education
Blooms Taxonomy in Engineering Education
Dr. A. B. Shinde
 
ISE 7.1i Software
ISE 7.1i SoftwareISE 7.1i Software
ISE 7.1i Software
Dr. A. B. Shinde
 
VHDL Coding Syntax
VHDL Coding SyntaxVHDL Coding Syntax
VHDL Coding Syntax
Dr. A. B. Shinde
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
Dr. A. B. Shinde
 
VLSI Testing Techniques
VLSI Testing TechniquesVLSI Testing Techniques
VLSI Testing Techniques
Dr. A. B. Shinde
 
Selecting Engineering Project
Selecting Engineering ProjectSelecting Engineering Project
Selecting Engineering Project
Dr. A. B. Shinde
 
Interview Techniques
Interview TechniquesInterview Techniques
Interview Techniques
Dr. A. B. Shinde
 
Semiconductors
SemiconductorsSemiconductors
Semiconductors
Dr. A. B. Shinde
 
Ad

Recently uploaded (20)

Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Ad

Introduction to Python programming language

  • 1. Dr. A. B. Shinde Assistant Professor, Electronics and Computer Science, P V P Institute of Technology, Sangli Introduction to Python
  • 2. Dr. A. B. Shinde Contents… • Introduction: • History of Python, • Need of Python, • Features of Python, • Comparison with C and Java, • Python Building Blocks: – Keywords, Identifiers, – Variables, Comments, Docstring, – Indentation, Input-Output. • Python Installation: • Python Installation with 3.x version, Working with various IDE: • Command Prompt, IDLE, Jupyter Notebook, Google Colab, Pycharm, VS Code, Spyder. 2
  • 4. Dr. A. B. Shinde Python History 4  Python is a widely used general-purpose, high-level programming language.  It was initially designed by Guido Van Rossum in 1991 and developed by Python Software Foundation.  It was mainly developed to emphasize code readability, and its syntax allows programmers to express concepts in fewer lines of code.
  • 5. Dr. A. B. Shinde Python History 5  In the late 1980s, working on Python started.  Soon after that, Guido Van Rossum began doing its application-based work in December of 1989 at Centrum Wiskunde & Informatica (CWI) which is situated in the Netherlands.  It was started as a hobby project because he was looking for an interesting project to keep him occupied during Christmas.
  • 6. Why Python ??? Dr. A. B. Shinde
  • 7. Dr. A. B. Shinde What is Python? 7  Python is a high-level programming language celebrated for its simplicity, readability, and versatility.  Python supports multiple programming paradigms and boosts an extensive standard library that simplifies coding tasks.  Its large ecosystem of third-party libraries and frameworks further enhances its capabilities, making it a top choice for web development, scientific computing, data analysis, artificial intelligence, machine learning, and automation.  Python’s clear syntax and strong community support contribute to its popularity among beginners and experienced developers.
  • 8. Dr. A. B. Shinde Why Python? 8 Data Science • Python is the preferred programming language of most data scientists. • With the release of NumPy and Pandas, Python rose to prominence in the world of data. • Python also handles statistical, tabular and matrix data and also visualizes it with libraries like Matplotlib and Seaborn. Easy to Learn • Python’s resemblance to the English language makes it easy to master. • Python’s syntax is characterized by very few rules and special cases. • Another attractive aspect of this programming language is its efficiency and readability.
  • 9. Dr. A. B. Shinde Why Python? 9 Cross-Platform and Open Source • It’s been more than 20 years since this language has been running cross-platform and open source. • Be it Linux, Windows or MacOS, Python code works on every platform. Vast Libraries • Python is supported by PyPI which has 85,000+ python scripts and modules accessible to the user. • These modules provide pre-packaged functionality available to the users in their local Python environment.
  • 10. Dr. A. B. Shinde Why Python? 10 Benefits of using Python • Readability: Python’s syntax is designed to be easily readable, making it easier to write and maintain code. • Easy to learn and use: Python’s simple syntax makes it beginner- friendly • Extensive libraries and frameworks: Offers rich libraries for web development, data science, AI, etc.​ • Versatile: Supports multiple programming paradigms and applications​ • Cross-platform: Works seamlessly across Windows, macOS, and Linux​ • Great for rapid prototyping: Quick syntax allows for fast idea implementation
  • 11. Features of Python Dr. A. B. Shinde
  • 12. Dr. A. B. Shinde Features of Python 12 1. Free and Open Source • Python language is freely available at the official website. • It is open-source, this means that source code is also available to the public. 2. Easy to code • Python is very easy to learn as compared to other languages like C, C#, Javascript, Java, etc. • It is also a developer-friendly language. 3. Easy to Read • Python’s syntax are straightforward. • It makes the code more readable.
  • 13. Dr. A. B. Shinde Features of Python 13 4. Object-Oriented Language • Python supports object-oriented language and concepts of classes, object encapsulation, etc. 5. GUI Programming Support • Graphical User interfaces can be made using a module such as PyQt5, wxPython, or Tk in Python. PyQt5 is the most popular option for creating graphical apps with Python. 6. High-Level Language • Python is a high-level language. 7. Large Community Support • Questions are constantly answered by the community.
  • 14. Dr. A. B. Shinde Features of Python 14 8. Easy to Debug • Excellent for mistake tracing. You will be able to quickly identify and correct the majority of your program’s issues once you understand how to interpret Python’s error traces. 9. Python is a Portable language • Python language is also a portable language, we can run python code on any platform. • Python code written for Windows can run on other platforms such as Linux, Unix, and Mac then we do not need to change it, 10. Python is an Integrated language • Python is also an Integrated language because we can easily integrate Python with other languages like C, C++, etc.
  • 15. Dr. A. B. Shinde Features of Python 15 11. Interpreted Language: • Python is an Interpreted Language because Python code is executed line by line at a time. • There is no need to compile Python code this makes it easier to debug our code. 12. Large Standard Library • Python has a large standard library that provides a rich set of modules and functions 13. Dynamically Typed Language • Python is a dynamically-typed language. That means the type (for example- int, double, long, etc.) for a variable is decided at run time not in advance because of this feature we don’t need to specify the type of variable.
  • 16. Dr. A. B. Shinde Features of Python 16 14. Frontend and backend development • With a new project py script, you can run and write Python codes in HTML with the help of some simple tags <py-script>, <py-env>, etc. • This will help you do frontend development work in Python like javascript. • Backend is the strong forte of Python it’s extensively used for this work cause of its frameworks like Django and Flask. 15. Allocating Memory Dynamically • In Python, the variable data type does not need to be specified. • The memory is automatically allocated to a variable at runtime when it is given a value.
  • 17. Comparison with Other Languages Dr. A. B. Shinde
  • 18. Dr. A. B. Shinde Comparison of Python 18 Feature Python C C++ Java Type Interpreted Compiled Compiled Compiled and Interpreted Paradigm Multi-paradigm (object- oriented, procedural, functional) Procedural, structured Multi-paradigm (procedural, object- oriented, generic) Object-oriented, structured Memory Management Automatic Manual Manual Automatic Syntax Simple Complex Complex Complex Use Cases Web development, data analysis, machine learning System programming, embedded systems, game development System programming, game development, high-performance applications Large-scale applications, enterprise software Notable Frameworks/ Libraries Django, Flask Standard Library Standard Library, Boost Spring, Hibernate Community Support Strong Strong Strong Strong
  • 19. Dr. A. B. Shinde Comparison of Python 19  Python vs Java For Example, Here is a code in Java Same code written in Python
  • 20. Python Building Blocks: Basics Dr. A. B. Shinde
  • 21. Dr. A. B. Shinde Python Basics 21  Python Syntax  Syntax refers to the set of rules that defines how to write and organize code so that the Python interpreter can understand and run it correctly.  These rules ensure that your code is structured, formatted, and error- free.
  • 22. Dr. A. B. Shinde Python Basics 22  Python keywords  Keywords are reserved words that have special meanings and serve specific purposes in the language syntax.  They cannot be used as identifiers (names for variables, functions, classes, etc.).  For instance, "for", "while", "if", and "else" are keywords and cannot be used as identifiers. alse await else import pa one break except in raise rue class finally is return nd continue for lambda try s def from nonlocal while ssert del global not with sync elif if or yield
  • 23. Dr. A. B. Shinde Python Basics 23 • Python Identifiers • In identifiers are unique names that are assigned to variables, functions, classes, and other entities. • They are used to uniquely identify the entity within the program. • They should start with a letter (a-z, A-Z) or an underscore "_" and can be followed by letters, numbers, or underscores. • In the below example "first_name" is an identifier that store string value. first_name = "Ram"
  • 24. Dr. A. B. Shinde Python Basics 24  Python Identifiers • Identifier : some rules • Identifiers can be composed of alphabets (either uppercase or lowercase), numbers (0-9), and the underscore character (_). • They shouldn't include any special characters or spaces. • The starting character of an identifier must be an alphabet or an underscore. • Within a specific scope or namespace, each identifier should have a distinct name to avoid conflicts. A = 3.14 x = 3.14 Num = 3.14 Sagar = 3.14 Pi = 3.14
  • 25. Dr. A. B. Shinde Python Basics 25 • Python Variables • Variables in Python are essentially named references pointing to objects in memory. • You don't need to declare a variable's type explicitly in Python. Based on the value assigned, Python will dynamically determine the type. • In the below example, variable 'a' is initialize with integer value and variable 'b' with a string. Because of dynamic-types behavior, data type will be decide during runtime.
  • 26. Dr. A. B. Shinde Python Basics 26 • Comments in Python • Comments are used to explain, clarify, or give context about specific parts of the code. • The purpose of comments is to explain the working of a code, they have no impact on the execution or outcome of a program. • Python Single Line Comment • Single line comments are preceded by the "#" symbol. • Everything after this symbol on the same line is considered a comment.
  • 27. Dr. A. B. Shinde Python Basics 27  Comments in Python • Python Multi-line Comment • Python doesn't have a specific syntax for multi-line comments. • However, programmers often use multiple single-line comments, one after the other, or sometimes triple quotes (either ''' or """), even though they're technically string literals. • Below is the example of multiline comment.
  • 28. Dr. A. B. Shinde Python Basics 28 • Multiple Line Statements • Writing a long statement in a code is not feasible or readable. • Breaking a long line of code into multiple lines makes is more readable. • Using Backslashes () • In Python, you can break a statement into multiple lines using the backslash ().
  • 29. Dr. A. B. Shinde Python Basics 29 • Continuation of Statements in Python • Statements are typically written on a single line. • There are scenarios where writing a statement on multiple lines can improve readability or is required due to the length of the statement. • Implicit Continuation • Python implicitly supports line continuation within parentheses ( ), square brackets [ ], and curly braces { }.
  • 30. Dr. A. B. Shinde Python Basics 30 • Continuation of Statements in Python • Statements are typically written on a single line. • There are scenarios where writing a statement on multiple lines can improve readability or is required due to the length of the statement. • Explicit Continuation • You can use backslash '' to indicate that a statement should continue on the next line.
  • 31. Dr. A. B. Shinde Python Basics 31 • Input from User in Python • The input( ) function in Python is used to take user input from the console. • The program execution halts until the user provides input and presses "Enter". The entered data is then returned as a string. • Example: The user will see the message "Please enter your name: ". • After entering their name and pressing "Enter", they'll receive a greeting with the name they provided.
  • 32. Dr. A. B. Shinde Python Basics 32 • Input from User in Python • Take Multiple Input in Python • We are taking multiple inputs from the user in a single line, splitting the values entered by the user into separate variables for each value using the split( ) method. • Then, it prints the values with corresponding labels, either two or three, based on the number of inputs provided by the user
  • 33. Dr. A. B. Shinde Python Basics 33 • Input from User in Python • Take Conditional Input from user • The input is converted to an integer using the int() function. • Then, the program uses conditional statements to check the age range and prints a message based on whether the user is a minor, an adult, or a senior citizen.
  • 34. Dr. A. B. Shinde Python Basics 34  Output in Python: • print( ) • print() function allows us to display text, variables and expressions on the console. • In this example, “SY ECS, PVPIT” is a string literal enclosed within double quotes.
  • 35. Dr. A. B. Shinde Python Basics 35  Output in Python: • Printing Variables • We can use the print( ) function to print single and multiple variables. • We can print multiple variables by separating them with commas. • Example:
  • 36. Dr. A. B. Shinde Python Basics 36  Output in Python:  Output Formatting  Example: Using Format( )
  • 37. Dr. A. B. Shinde Python Basics 37  Output in Python:  Output Formatting  Example: Using sep and end parameter
  • 38. Dr. A. B. Shinde Python Basics 38  Output in Python:  Output Formatting  Example: Using f-string
  • 39. This presentation is published only for educational purpose Thank You… [email protected]