SlideShare a Scribd company logo
INTRODUCTION
TO
PYTHON
Dr. S. SELVAKANMANI,
ASSOCIATE PROFESSOR,
DEPARTMENT OF CSE,
VELAMMAL I TECH
AGENDA
 Companies using Python
 Top languages for Data Science
 Introduction to Python & Features
 Installation of Python
 Working in IDLE
 Working in Jupyter Notebook
 Interactive Vs Script Mode
PYTHON - INTRODUCTION
 Developed in late 1980 by Guido Van Rossum at National
Research Institute for Mathematics and Computer Science
in Netherlands.
Features of Python:
 Simple – It is simple to learn, read and write
 High level language – Program codes contains easy to
read syntax that is later converted into a low level language
(i.e binary codes)
PYTHON – INTRODUCTION Contd..
 Open Source – It is freely available and the source code is
available for free.
 Cross Platform/Portable - Python can run equally on
different platforms such as Windows, Linux, Unix, and
Macintosh etc.
 Interpreted Language – Python program written will be
converted into intermediate language which is again
translated into native or machine language for execution.
PYTHON – INTRODUCTION Contd..
PYTHON – INTRODUCTION Contd..
 Interpreter translates just one statement of the program at
a time into machine code.
Vs
 Compiler scans the entire program and translates the
whole of it into machine code at once.
PYTHON – INTRODUCTION Contd..
 Case – Sensitive Language – Difference between
Uppercase and lowercase letters. i.e area, Area.
 Object Oriented Language - Python structures a
program by bundling related properties and behaviors into
individual objects.
 Automatic Type Inference – Doesn‟t need to define the type
of the data during its declaration.
PYTHON – INTRODUCTION Contd..
 Scripting language – Uses an Interpreter to translate its
source code. The interpreter reads and executes each line of
code one at a time (like a “script” in a play/audition)
 No worry about memory allocation
 Interface with existing programming language –
Comes with a large standard library that supports many
common tasks.
 No Semicolon at the end of the statement
PYTHON – INSTALLATION
 Downloads available in www.python.org (Known as Cpython
Installation and it comes with Python Interpreter , Python IDLE
and PIP ( Package Installer )
 Other Python distributions available in Anaconda Python
distribution (https://www.anaconda.com/distribution/),
comes with preloaded packages such as NumPy , SciPy, Pandas
etc .
 Other Popular downloads available in form of Spyder IDE ,
PyCharm IDE etc.. (https://www.guru99.com/python-ide-code-
editor.html)
PYTHON – WORKING IN IDLE
 IDLE – Integrated Development and Learning Environment
 Two modes of working : (i) Interactive mode and (ii) Script
mode
 Interactive Mode : Writing & Executing one command at
a time. ( Click Start – All Programs – Python x.x –IDLE )
 Type the commands in the prompt (>>>) and hit Enter to
see the output.
PYTHON – INTERACTIVE MODE
>>> - Chevron
PYTHON – WORKING IN IDLE
 Script Mode : Writing & Executing Programs.
 (Click Start – All Programs – Python x.x – IDLE )
 ( Click File – New – in Python IDLE shell )
 Type the commands in the newly opened window and save the
program with the extension (.py )
 For Execution , Click Run – Run Module or Press F5.
PYTHON – SCRIPT MODE
PYTHON – FEATURES OF IDLE
 Multi-window text editor with syntax highlighting.
 Auto completion with smart indentation.
 Python shell to display output with syntax highlighting.
PYTHON – WORKING IN JUPYTER NOTEBOOK
 Launch Anaconda Navigator from Start – All Programs –
Anaconda –Anaconda Navigator .
 Click on Launch JUPYTER Notebook (Opens in Web
Browser)
 Select Python3 by clicking on the drop down arrow mark of
New Option placed on the right hand side of the Dashboard.
 JUPYTER = JUlia, PYThon and R
PYTHON – JUPYTER NOTEBOOK
PYTHON – WORKING IN JUPYTER NOTEBOOK
 In this window, the code can be written within the cell
provided.
 If using Interactive mode, Type the commands in the Cell
and Press Run or Shift Enter.
 If using Script mode, Type the commands in the Cell , save
the file by clicking on Untitled1 , Click Run to run your
program
PYTHON – JUPYTER NOTEBOOK
PYTHON – INTERACTIVE Vs SCRIPT MODE
PYTHON – VIRTUAL ENVIRONMENT
https://repl.it
colab.research.google.com
https://www.codechef.com/ide
https://pynative.com/online-python-code-
editor-to-execute-python-code/
https://www.jdoodle.com/python3-
programming-online/
PYTHON – SYNTAX
 Keywords – Set of predefined words. A prescribed rule of
usage for each keyword is called a syntax.
 Python 3.x interpreter has 33 keywords defined in it.
 Since they have a predefined meaning attached, they cannot
be used for any other purpose.
 To know the list of python keywords:
>>>help('keywords')
PYTHON – LIST OF KEYWORDS : 33 nos.
PYTHON – SYNTAX
 Apart from Keywords, Python program can have variables,
functions, classes, modules, packages etc.
 Identifier is the name given to these programming elements.
 An identifier should start with either an alphabet letter (lower or
upper case) or an underscore (_).
 After that, more than one alphabet letters (a-z or A-Z), digits (0-
9) or underscores may be used to form an identifier.
 No other characters are allowed such as @,#,$, etc
 Identifiers are case – sensitive.
PYTHON – SYNTAX
 Eg: Names like myClass, var_1, and
this_is_a_long_variable
PYTHON – STATEMENT
 By default, the Python interpreter treats a piece of text
terminated by hard carriage return (i.e new line character) as one
statement.
 It means each line in a Python script is a statement.
 (Just as in C/C++/C#, a semicolon ; denotes the end of a
statement).
 Eg1: msg="Hello World"
 Eg2: code=123
 Eg3: name="Steve"
Use the semicolon ; to write multiple
statements in a single line.
Eg:
msg='"Hello World";code=123;name="Steve"'
PYTHON – STATEMENT
Continuation of Statement: We can show the text spread over
more than one lines to be a single statement by using the
backslash () as a continuation character.
 Eg:
msg="Hello Python Learners  <enter>
Welcome to Python Tutorial  <enter>
from CSE Department"
PYTHON – INDENTS
 Many times it is required to construct a block of more than one
statements.
 For example there might be multiple statements that are part of
the definition of a function or method.
 Most of the programming languages like C, C++, Java use braces
{ } to define a block of code. But, python uses indentation.
 Blocks of code are denoted by line indentation.
 It is a space given to the block of codes for class and
function definitions or flow control.
PYTHON – INDENTS
 When a block is to be started, type the colon symbol (:) and
press Enter.
 Any Python-aware editor (like IDLE) goes to the next line
leaving an additional whitespace (called indent).
 Subsequent statements in the block follow the same level of
indent.
PYTHON – COMMENTS
 A hash sign (#) is the beginning of a comment.
 Anything written after # in a line is ignored by interpreter.
 Eg: percentage = (minute * 100) / 60 # calculating
percentage of an hour
 Python does not have multiple-line commenting feature. You
have to comment each line individually as follows :
# this is a comment
print ("Hello World")
print ("Welcome to Python Tutorial") #this is also a comment but after a statement
Use triple – quote
for mutli – line
comment
PYTHON – INPUT AND OUTPUT
 Input is data entered by user (end user) in the program.
 In python, input () function is available for input.
 Syntax is:
variable = input (“data”)
 Eg:
>>> x=input("enter the name:")
enter the name: George
>>>y=int(input("enter the number"))
 enter the number 3
Python accepts string as default data type. Conversion is required for type.
A function is a block of
code which only runs
when it is called.
A set of statements
which perform a
specific tasks.
PYTHON – INPUT AND OUTPUT
 OUTPUT: Output can be displayed to the user using print
statement .
 Syntax:
print (expression/constant/variable)
 Example:
>>> print ("Hello")
Hello
PYTHON – VARIABLE
 Any value of certain type is stored in the computer's memory for
processing.
 Out of available memory locations, one is randomly allocated for
storage.
 In order to conveniently and repeatedly refer to the stored value,
it is given a suitable name.
 A value is bound to a name by the assignment operator '='.
 Eg:
A = 3
PYTHON – VARIABLE
Eg:
A = 3
 A is the identifier and 3 is the value assigned to it.
 The same identifier can be used to refer to another value.
Eg:
A = „hello‟
 So, the value being referred can change (or vary), hence it is
called a variable.
 It is important to remember that a variable is a name given
to a value, and not to a memory location storing the value.
THANK
YOU

More Related Content

Similar to Python PPT1.pdf

Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
BijuAugustian
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
cigogag569
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
Bhavsingh Maloth
 
Chapter - 1.pptx
Chapter - 1.pptxChapter - 1.pptx
Chapter - 1.pptx
MikialeTesfamariam
 
Python final presentation kirti ppt1
Python final presentation kirti ppt1Python final presentation kirti ppt1
Python final presentation kirti ppt1
Kirti Verma
 
Introduction python
Introduction pythonIntroduction python
Introduction python
Jumbo Techno e_Learning
 
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Language
anaveenkumar4
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
Python Programming | JNTUK | UNIT 1 | Lecture 3
Python Programming | JNTUK | UNIT 1 | Lecture 3Python Programming | JNTUK | UNIT 1 | Lecture 3
Python Programming | JNTUK | UNIT 1 | Lecture 3
FabMinds
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdf
VisionAcademyProfSac
 
intro.pptx (1).pdf
intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdf
ANIKULSAIKH
 
introduction of python in data science
introduction of python in data scienceintroduction of python in data science
introduction of python in data science
bhavesh lande
 
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdfBASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
ashaks17
 
PYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdfPYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdf
Ramakrishna Reddy Bijjam
 
Intro-to-Python-Part-1-first-part-edition.pdf
Intro-to-Python-Part-1-first-part-edition.pdfIntro-to-Python-Part-1-first-part-edition.pdf
Intro-to-Python-Part-1-first-part-edition.pdf
ssuser543728
 

Similar to Python PPT1.pdf (20)

Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
 
Chapter - 1.pptx
Chapter - 1.pptxChapter - 1.pptx
Chapter - 1.pptx
 
Python final presentation kirti ppt1
Python final presentation kirti ppt1Python final presentation kirti ppt1
Python final presentation kirti ppt1
 
Introduction python
Introduction pythonIntroduction python
Introduction python
 
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Language
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
Python Programming | JNTUK | UNIT 1 | Lecture 3
Python Programming | JNTUK | UNIT 1 | Lecture 3Python Programming | JNTUK | UNIT 1 | Lecture 3
Python Programming | JNTUK | UNIT 1 | Lecture 3
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdf
 
intro.pptx (1).pdf
intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdf
 
introduction of python in data science
introduction of python in data scienceintroduction of python in data science
introduction of python in data science
 
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdfBASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
 
PYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdfPYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdf
 
Intro-to-Python-Part-1-first-part-edition.pdf
Intro-to-Python-Part-1-first-part-edition.pdfIntro-to-Python-Part-1-first-part-edition.pdf
Intro-to-Python-Part-1-first-part-edition.pdf
 

Recently uploaded

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
Yasser Mahgoub
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
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
ijaia
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
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
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 

Recently uploaded (20)

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
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
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
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
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 

Python PPT1.pdf

  • 1. INTRODUCTION TO PYTHON Dr. S. SELVAKANMANI, ASSOCIATE PROFESSOR, DEPARTMENT OF CSE, VELAMMAL I TECH
  • 2. AGENDA  Companies using Python  Top languages for Data Science  Introduction to Python & Features  Installation of Python  Working in IDLE  Working in Jupyter Notebook  Interactive Vs Script Mode
  • 3.
  • 4.
  • 5. PYTHON - INTRODUCTION  Developed in late 1980 by Guido Van Rossum at National Research Institute for Mathematics and Computer Science in Netherlands. Features of Python:  Simple – It is simple to learn, read and write  High level language – Program codes contains easy to read syntax that is later converted into a low level language (i.e binary codes)
  • 6. PYTHON – INTRODUCTION Contd..  Open Source – It is freely available and the source code is available for free.  Cross Platform/Portable - Python can run equally on different platforms such as Windows, Linux, Unix, and Macintosh etc.  Interpreted Language – Python program written will be converted into intermediate language which is again translated into native or machine language for execution.
  • 8. PYTHON – INTRODUCTION Contd..  Interpreter translates just one statement of the program at a time into machine code. Vs  Compiler scans the entire program and translates the whole of it into machine code at once.
  • 9. PYTHON – INTRODUCTION Contd..  Case – Sensitive Language – Difference between Uppercase and lowercase letters. i.e area, Area.  Object Oriented Language - Python structures a program by bundling related properties and behaviors into individual objects.  Automatic Type Inference – Doesn‟t need to define the type of the data during its declaration.
  • 10. PYTHON – INTRODUCTION Contd..  Scripting language – Uses an Interpreter to translate its source code. The interpreter reads and executes each line of code one at a time (like a “script” in a play/audition)  No worry about memory allocation  Interface with existing programming language – Comes with a large standard library that supports many common tasks.  No Semicolon at the end of the statement
  • 11. PYTHON – INSTALLATION  Downloads available in www.python.org (Known as Cpython Installation and it comes with Python Interpreter , Python IDLE and PIP ( Package Installer )  Other Python distributions available in Anaconda Python distribution (https://www.anaconda.com/distribution/), comes with preloaded packages such as NumPy , SciPy, Pandas etc .  Other Popular downloads available in form of Spyder IDE , PyCharm IDE etc.. (https://www.guru99.com/python-ide-code- editor.html)
  • 12. PYTHON – WORKING IN IDLE  IDLE – Integrated Development and Learning Environment  Two modes of working : (i) Interactive mode and (ii) Script mode  Interactive Mode : Writing & Executing one command at a time. ( Click Start – All Programs – Python x.x –IDLE )  Type the commands in the prompt (>>>) and hit Enter to see the output.
  • 13. PYTHON – INTERACTIVE MODE >>> - Chevron
  • 14. PYTHON – WORKING IN IDLE  Script Mode : Writing & Executing Programs.  (Click Start – All Programs – Python x.x – IDLE )  ( Click File – New – in Python IDLE shell )  Type the commands in the newly opened window and save the program with the extension (.py )  For Execution , Click Run – Run Module or Press F5.
  • 16. PYTHON – FEATURES OF IDLE  Multi-window text editor with syntax highlighting.  Auto completion with smart indentation.  Python shell to display output with syntax highlighting.
  • 17. PYTHON – WORKING IN JUPYTER NOTEBOOK  Launch Anaconda Navigator from Start – All Programs – Anaconda –Anaconda Navigator .  Click on Launch JUPYTER Notebook (Opens in Web Browser)  Select Python3 by clicking on the drop down arrow mark of New Option placed on the right hand side of the Dashboard.  JUPYTER = JUlia, PYThon and R
  • 18. PYTHON – JUPYTER NOTEBOOK
  • 19. PYTHON – WORKING IN JUPYTER NOTEBOOK  In this window, the code can be written within the cell provided.  If using Interactive mode, Type the commands in the Cell and Press Run or Shift Enter.  If using Script mode, Type the commands in the Cell , save the file by clicking on Untitled1 , Click Run to run your program
  • 20. PYTHON – JUPYTER NOTEBOOK
  • 21. PYTHON – INTERACTIVE Vs SCRIPT MODE
  • 22. PYTHON – VIRTUAL ENVIRONMENT https://repl.it colab.research.google.com https://www.codechef.com/ide https://pynative.com/online-python-code- editor-to-execute-python-code/ https://www.jdoodle.com/python3- programming-online/
  • 23. PYTHON – SYNTAX  Keywords – Set of predefined words. A prescribed rule of usage for each keyword is called a syntax.  Python 3.x interpreter has 33 keywords defined in it.  Since they have a predefined meaning attached, they cannot be used for any other purpose.  To know the list of python keywords: >>>help('keywords')
  • 24. PYTHON – LIST OF KEYWORDS : 33 nos.
  • 25. PYTHON – SYNTAX  Apart from Keywords, Python program can have variables, functions, classes, modules, packages etc.  Identifier is the name given to these programming elements.  An identifier should start with either an alphabet letter (lower or upper case) or an underscore (_).  After that, more than one alphabet letters (a-z or A-Z), digits (0- 9) or underscores may be used to form an identifier.  No other characters are allowed such as @,#,$, etc  Identifiers are case – sensitive.
  • 26. PYTHON – SYNTAX  Eg: Names like myClass, var_1, and this_is_a_long_variable
  • 27. PYTHON – STATEMENT  By default, the Python interpreter treats a piece of text terminated by hard carriage return (i.e new line character) as one statement.  It means each line in a Python script is a statement.  (Just as in C/C++/C#, a semicolon ; denotes the end of a statement).  Eg1: msg="Hello World"  Eg2: code=123  Eg3: name="Steve" Use the semicolon ; to write multiple statements in a single line. Eg: msg='"Hello World";code=123;name="Steve"'
  • 28. PYTHON – STATEMENT Continuation of Statement: We can show the text spread over more than one lines to be a single statement by using the backslash () as a continuation character.  Eg: msg="Hello Python Learners <enter> Welcome to Python Tutorial <enter> from CSE Department"
  • 29. PYTHON – INDENTS  Many times it is required to construct a block of more than one statements.  For example there might be multiple statements that are part of the definition of a function or method.  Most of the programming languages like C, C++, Java use braces { } to define a block of code. But, python uses indentation.  Blocks of code are denoted by line indentation.  It is a space given to the block of codes for class and function definitions or flow control.
  • 30. PYTHON – INDENTS  When a block is to be started, type the colon symbol (:) and press Enter.  Any Python-aware editor (like IDLE) goes to the next line leaving an additional whitespace (called indent).  Subsequent statements in the block follow the same level of indent.
  • 31. PYTHON – COMMENTS  A hash sign (#) is the beginning of a comment.  Anything written after # in a line is ignored by interpreter.  Eg: percentage = (minute * 100) / 60 # calculating percentage of an hour  Python does not have multiple-line commenting feature. You have to comment each line individually as follows : # this is a comment print ("Hello World") print ("Welcome to Python Tutorial") #this is also a comment but after a statement Use triple – quote for mutli – line comment
  • 32. PYTHON – INPUT AND OUTPUT  Input is data entered by user (end user) in the program.  In python, input () function is available for input.  Syntax is: variable = input (“data”)  Eg: >>> x=input("enter the name:") enter the name: George >>>y=int(input("enter the number"))  enter the number 3 Python accepts string as default data type. Conversion is required for type. A function is a block of code which only runs when it is called. A set of statements which perform a specific tasks.
  • 33. PYTHON – INPUT AND OUTPUT  OUTPUT: Output can be displayed to the user using print statement .  Syntax: print (expression/constant/variable)  Example: >>> print ("Hello") Hello
  • 34. PYTHON – VARIABLE  Any value of certain type is stored in the computer's memory for processing.  Out of available memory locations, one is randomly allocated for storage.  In order to conveniently and repeatedly refer to the stored value, it is given a suitable name.  A value is bound to a name by the assignment operator '='.  Eg: A = 3
  • 35. PYTHON – VARIABLE Eg: A = 3  A is the identifier and 3 is the value assigned to it.  The same identifier can be used to refer to another value. Eg: A = „hello‟  So, the value being referred can change (or vary), hence it is called a variable.  It is important to remember that a variable is a name given to a value, and not to a memory location storing the value.