SlideShare a Scribd company logo
Akhil Kaushik
Asstt. Prof., CE Deptt.,
TIT Bhiwani
Python
Programming
Python Introduction
• Python is a popular programming
language.
• It was created by Guido van Rossum,
and released in 1991.
• Python source code is also available
under the GNU General Public License
(GPL).
Python Introduction
• Python is a general-purpose interpreted,
interactive, object-oriented and high-level
programming language.
• Python is designed to be highly readable.
• Python has a simple syntax similar to the English
language.
Programming….Why?
Type of Languages
1. Binary Level
Language
2. Assembly Level
Language
3. High Level
Language
Need for programming languages?
• Closer to human thinking behavior.
• Program’s size is shorter.
• Error detection is easy.
• Same program can be compiled in accordance
to different machine architectures.
History
• Software for early computers were
written in assembly language.
• The need of reusability of code gave
birth to programming languages.
• This need grow huge to overcome the
cost restriction of compiler.
Translators
What is a Compiler?
What is a Compiler?
Source Language Target Language
Translators - Interpreter
• It is another common kind of language processor.
• Instead of producing a target program as a
translation, it directly execute the operations
specified in the source program on inputs supplied
by the user.
Translators - Interpreter
• This software converts the high-level language
into low-level language line by line.
• It takes less memory than compiler.
• It takes more time than compiler.
• It is more efficient in error detection than
compiler.
• It takes more time to build.
Translators - Interpreter
• Java language processors combine compilation
and interpretation.
• A Java source program may first be compiled into
an intermediate form called bytecodes.
• The bytecodes are then interpreted by a virtual
machine.
• A benefit of this arrangement is that bytecodes
compiled on one machine can be interpreted on
another machine, perhaps across a network.
Translators - Interpreter
Translators - Assembler
• This software converts the assembly language
(assembly instruction mnemonics) into machine
level language (opcodes i.e. 0,1).
• It offers reusability of assembly codes on different
machine platforms.
Translators - Assembler
• It generates instructions by evaluating the
mnemonics (symbols) in operation field and find
the value of symbol and literals to produce
machine code.
• Now, if assembler do all this work in one scan then
it is called single pass assembler, otherwise if it
does in multiple scans then called multiple pass
assembler.
Translators - Assembler
• Pass-1:
– Define symbols and literals and remember them in
symbol table and literal table respectively.
– Keep track of location counter
– Process pseudo-operations
• Pass-2:
– Generate object code by converting symbolic op-code
into respective numeric op-code
– Generate data for literals and look for values of
symbols
Translators - Assembler
Translators - Linker
• A linker is a program that allows a user
to link library programs or separate
modules of code into their own
programs.
• It is used to combine different modules
of object code into one single
executable code program.
Translators - Linker
• This may involve combining a program with library
programs, or involve recombining blocks of object
code from the same program, or a mixture of both.
• The linker program is used to recombine the
blocks of object code in RAM to get a working full
program.
• Linker is helpful if there is a shortage of RAM.
Translators - Loader
• A loader is a piece of software that chooses
exactly where to put object code in RAM, ready for
it to be run.
• It also adjusts the memory references in programs.
Translators - Loader
• Programs can be written by programmers using
either ‘absolute addressing’ or ‘relative addressing’.
• Relative addressing is more common because then
the loader can put the program anywhere in RAM -
absolute addressing isn't flexible.
• Linker & Loader may overlap.
Translators - Loader
Why Python?
• It is used for:
– web development (server-side applications),
– software development (rapid prototyping),
– handling big data and mathematics,
– Connecting to database systems,
– system scripting.
Why Python?
• It supports functional and object oriented
programming.
• It can be used as a scripting language or can be
compiled to byte-code for building large applications.
• It provides very high-level dynamic data types and
supports dynamic type checking.
• It supports automatic garbage collection.
Why Python?
• Python works on different platforms (Windows, Mac,
Linux, Raspberry Pi, etc).
• Python has syntax that allows developers to write
programs with fewer lines.
• Python runs on an interpreter system, which makes
prototyping very quick.
• It can be easily integrated with C, C++, COM,
ActiveX, CORBA, and Java.
Why Python?
• The current version is Python 3.8
• Earlier version – Python 2 is quite
popular and has frequent security
updates.
• Some other versions of Python
are 1.0, 1.5, 1.6, 2.0, 2.1, 2.2, 2.3,
2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2,
3.3, 3.4, 3.5, 3.6, 3.7.
Summary - Why Python?
• Easy to learn, read and maintain
• Broad standard library for all
platforms.
• Portable & extendable.
• Interactive testing & debugging.
• Support for all major databases.
• Support for GUI applications.
Summary - Why Python?
• Python uses new lines
to complete a command,
instead of ; or {}.
• Python relies on
indentation, using
whitespace, to define
scope; such as the
scope of loops,
functions and classes.
How to get started?
• Usually, Python comes pre-installed in Windows,
Linux and Mac OS.
• To check, search in the start bar for Python or run
the following on the Command Line (cmd.exe):
C:UsersYour Name>python --version
How to get started?
• Else, we can download python from website:
https://www.python.org/
• You can download Python documentation from:
https://www.python.org/doc/
• The documentation is available in HTML, PDF, and
PostScript formats.
Steps to Install Python on Windows
• Open a Web browser and go
to https://www.python.org/downloads/.
• Follow the link for the Windows installer python-XYZ.msi file
where XYZ is the version you need to install.
• Save the installer file to your local machine and then run it to
find out if your machine supports MSI.
• Run the downloaded file. This brings up the Python install
wizard, which is really easy to use. Just accept the default
settings, wait until the install is finished, and you are done.
Steps to Install Python on Linux
• Open a Web browser and go to https://www.python.org/downloads
• Follow the link to download zipped source code available for
Unix/Linux.
• Download and extract files.
• Editing the Modules/Setup file if you want to customize some
options.
• run ./configure script -> make -> make install
• This installs Python at standard location /usr/local/bin and its
libraries at /usr/local/lib/pythonXX where XX is the version of
Python.
Steps to Install Python on Macintosh
• Recent Macs come with Python installed, but it
may be several years out of date.
• See http://www.python.org/download/mac/ for
instructions on getting the current version along
with extra tools to support development on the
Mac.
Setting up Path - Windows
• To add the Python directory to the path for a
particular session in Windows −
• At the command prompt − type path ->
Environment Variables -> path -> edit ->
%path%;C:Python and press Enter.
• Note − C:Python is the path of the Python directory
Setting up Path - Linux
• In the csh shell − type setenv PATH
"$PATH:/usr/local/bin/python" and press Enter.
• In the bash shell (Linux) − type export
PATH="$PATH:/usr/local/bin/python" and press Enter.
• In the sh or ksh shell − type
PATH="$PATH:/usr/local/bin/python" and press Enter.
• Note − /usr/local/bin/python is the path of the Python
directory
Running Python Code
• Interactive Interpreter (write Python or IPython in
command prompt)
– C:> python
• Script from the Command-line (write python code in
an editor and save with .py extension, then call
interpreter to run it)
– C: >python script.py
• Integrated Development Environment (IDE)
Python IDEs
• Jupyter
• Spyder
• Thonny
• PyCharm
• Komodo
• NetBeans
• &….so plethora of options…
Jupyter Notebook
• It is an open-source web application
that allows you to create and share
documents that may contain:
– Data cleaning & transformation,
– Equations & numerical simulation,
– Data visualizations and narrative text.
– Machine learning
– Deep learning
Jupyter Notebook
• Project Jupyter is a non-profit, open-source
project, born out of the IPython Project in 2014.
• It supports over 40 languages.
• It can also help us share notebooks.
• It gives interactive output.
• It also does big data integration.
Let’s start writing code…
Let’s start writing code…
• Download Anaconda from internet.
• I have anaconda 4.4.0 (64-bit).
• Write ‘Jupyter’ in the search box -> Jupyter Notebook.
• It will start and a new tab will open in your default
browser.
• Click on “New” dropdown box -> Python3
Let’s start writing code…
Let’s start writing code…
Let’s start writing code…
Keyboard shortcuts - Jupyter Notebook
• Shift + Enter run the current cell, select
below
• Ctrl + Enter run selected cells
• Alt + Enter run the current cell, insert below
• Ctrl + S save and checkpoint
• Ctrl + ] indent
• Ctrl + [ dedent
• H show all shortcuts
• Z undo cell deletion
• S Save and Checkpoint
• A insert cell above
• B insert cell below
• X cut selected cells
• C copy selected cells
• V paste cells below
• Shift + V paste cells above
• Y change the cell type to
Code
• M change the cell type to
Markdown
First Program
Akhil Kaushik
akhilkaushik05@gmail.com
9416910303
CONTACT ME AT:
Akhil Kaushik
akhilkaushik05@gmail.com
9416910303
THANK YOU !!!

More Related Content

What's hot

What's hot (20)

Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Python basics
Python basicsPython basics
Python basics
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Python Presentation
Python PresentationPython Presentation
Python Presentation
 
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...
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Python - the basics
Python - the basicsPython - the basics
Python - the basics
 
Introduction to python
 Introduction to python Introduction to python
Introduction to python
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Programming
ProgrammingProgramming
Programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
 
Python in 30 minutes!
Python in 30 minutes!Python in 30 minutes!
Python in 30 minutes!
 
Python basics
Python basicsPython basics
Python basics
 

Similar to Introduction to Python Programming

Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 

Similar to Introduction to Python Programming (20)

Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
 
Python programming 2nd
Python programming 2ndPython programming 2nd
Python programming 2nd
 
Introduction to Python Programming Basics
Introduction  to  Python  Programming BasicsIntroduction  to  Python  Programming Basics
Introduction to Python Programming Basics
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platforms
 
computer languages
computer languagescomputer languages
computer languages
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptx
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design Introduction
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
Python as Web Development
Python as Web Development Python as Web Development
Python as Web Development
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
 
Python_slides.pdf
Python_slides.pdfPython_slides.pdf
Python_slides.pdf
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 

More from Akhil Kaushik

More from Akhil Kaushik (20)

Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
 
Symbol Table
Symbol TableSymbol Table
Symbol Table
 
Lexical Analyzer Implementation
Lexical Analyzer ImplementationLexical Analyzer Implementation
Lexical Analyzer Implementation
 
NFA & DFA
NFA & DFANFA & DFA
NFA & DFA
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity Calculation
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
 
Basic programs in Python
Basic programs in PythonBasic programs in Python
Basic programs in Python
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Bootstrapping in Compiler
Bootstrapping in CompilerBootstrapping in Compiler
Bootstrapping in Compiler
 
Compiler construction tools
Compiler construction toolsCompiler construction tools
Compiler construction tools
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 

Recently uploaded (20)

UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 

Introduction to Python Programming

  • 1. Akhil Kaushik Asstt. Prof., CE Deptt., TIT Bhiwani Python Programming
  • 2. Python Introduction • Python is a popular programming language. • It was created by Guido van Rossum, and released in 1991. • Python source code is also available under the GNU General Public License (GPL).
  • 3. Python Introduction • Python is a general-purpose interpreted, interactive, object-oriented and high-level programming language. • Python is designed to be highly readable. • Python has a simple syntax similar to the English language.
  • 5. Type of Languages 1. Binary Level Language 2. Assembly Level Language 3. High Level Language
  • 6. Need for programming languages? • Closer to human thinking behavior. • Program’s size is shorter. • Error detection is easy. • Same program can be compiled in accordance to different machine architectures.
  • 7. History • Software for early computers were written in assembly language. • The need of reusability of code gave birth to programming languages. • This need grow huge to overcome the cost restriction of compiler.
  • 9. What is a Compiler?
  • 10. What is a Compiler? Source Language Target Language
  • 11. Translators - Interpreter • It is another common kind of language processor. • Instead of producing a target program as a translation, it directly execute the operations specified in the source program on inputs supplied by the user.
  • 12. Translators - Interpreter • This software converts the high-level language into low-level language line by line. • It takes less memory than compiler. • It takes more time than compiler. • It is more efficient in error detection than compiler. • It takes more time to build.
  • 13. Translators - Interpreter • Java language processors combine compilation and interpretation. • A Java source program may first be compiled into an intermediate form called bytecodes. • The bytecodes are then interpreted by a virtual machine. • A benefit of this arrangement is that bytecodes compiled on one machine can be interpreted on another machine, perhaps across a network.
  • 15. Translators - Assembler • This software converts the assembly language (assembly instruction mnemonics) into machine level language (opcodes i.e. 0,1). • It offers reusability of assembly codes on different machine platforms.
  • 16. Translators - Assembler • It generates instructions by evaluating the mnemonics (symbols) in operation field and find the value of symbol and literals to produce machine code. • Now, if assembler do all this work in one scan then it is called single pass assembler, otherwise if it does in multiple scans then called multiple pass assembler.
  • 17. Translators - Assembler • Pass-1: – Define symbols and literals and remember them in symbol table and literal table respectively. – Keep track of location counter – Process pseudo-operations • Pass-2: – Generate object code by converting symbolic op-code into respective numeric op-code – Generate data for literals and look for values of symbols
  • 19. Translators - Linker • A linker is a program that allows a user to link library programs or separate modules of code into their own programs. • It is used to combine different modules of object code into one single executable code program.
  • 20. Translators - Linker • This may involve combining a program with library programs, or involve recombining blocks of object code from the same program, or a mixture of both. • The linker program is used to recombine the blocks of object code in RAM to get a working full program. • Linker is helpful if there is a shortage of RAM.
  • 21. Translators - Loader • A loader is a piece of software that chooses exactly where to put object code in RAM, ready for it to be run. • It also adjusts the memory references in programs.
  • 22. Translators - Loader • Programs can be written by programmers using either ‘absolute addressing’ or ‘relative addressing’. • Relative addressing is more common because then the loader can put the program anywhere in RAM - absolute addressing isn't flexible. • Linker & Loader may overlap.
  • 24. Why Python? • It is used for: – web development (server-side applications), – software development (rapid prototyping), – handling big data and mathematics, – Connecting to database systems, – system scripting.
  • 25. Why Python? • It supports functional and object oriented programming. • It can be used as a scripting language or can be compiled to byte-code for building large applications. • It provides very high-level dynamic data types and supports dynamic type checking. • It supports automatic garbage collection.
  • 26. Why Python? • Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). • Python has syntax that allows developers to write programs with fewer lines. • Python runs on an interpreter system, which makes prototyping very quick. • It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
  • 27. Why Python? • The current version is Python 3.8 • Earlier version – Python 2 is quite popular and has frequent security updates. • Some other versions of Python are 1.0, 1.5, 1.6, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7.
  • 28. Summary - Why Python? • Easy to learn, read and maintain • Broad standard library for all platforms. • Portable & extendable. • Interactive testing & debugging. • Support for all major databases. • Support for GUI applications.
  • 29. Summary - Why Python? • Python uses new lines to complete a command, instead of ; or {}. • Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes.
  • 30. How to get started? • Usually, Python comes pre-installed in Windows, Linux and Mac OS. • To check, search in the start bar for Python or run the following on the Command Line (cmd.exe): C:UsersYour Name>python --version
  • 31. How to get started? • Else, we can download python from website: https://www.python.org/ • You can download Python documentation from: https://www.python.org/doc/ • The documentation is available in HTML, PDF, and PostScript formats.
  • 32. Steps to Install Python on Windows • Open a Web browser and go to https://www.python.org/downloads/. • Follow the link for the Windows installer python-XYZ.msi file where XYZ is the version you need to install. • Save the installer file to your local machine and then run it to find out if your machine supports MSI. • Run the downloaded file. This brings up the Python install wizard, which is really easy to use. Just accept the default settings, wait until the install is finished, and you are done.
  • 33. Steps to Install Python on Linux • Open a Web browser and go to https://www.python.org/downloads • Follow the link to download zipped source code available for Unix/Linux. • Download and extract files. • Editing the Modules/Setup file if you want to customize some options. • run ./configure script -> make -> make install • This installs Python at standard location /usr/local/bin and its libraries at /usr/local/lib/pythonXX where XX is the version of Python.
  • 34. Steps to Install Python on Macintosh • Recent Macs come with Python installed, but it may be several years out of date. • See http://www.python.org/download/mac/ for instructions on getting the current version along with extra tools to support development on the Mac.
  • 35. Setting up Path - Windows • To add the Python directory to the path for a particular session in Windows − • At the command prompt − type path -> Environment Variables -> path -> edit -> %path%;C:Python and press Enter. • Note − C:Python is the path of the Python directory
  • 36. Setting up Path - Linux • In the csh shell − type setenv PATH "$PATH:/usr/local/bin/python" and press Enter. • In the bash shell (Linux) − type export PATH="$PATH:/usr/local/bin/python" and press Enter. • In the sh or ksh shell − type PATH="$PATH:/usr/local/bin/python" and press Enter. • Note − /usr/local/bin/python is the path of the Python directory
  • 37. Running Python Code • Interactive Interpreter (write Python or IPython in command prompt) – C:> python • Script from the Command-line (write python code in an editor and save with .py extension, then call interpreter to run it) – C: >python script.py • Integrated Development Environment (IDE)
  • 38. Python IDEs • Jupyter • Spyder • Thonny • PyCharm • Komodo • NetBeans • &….so plethora of options…
  • 39. Jupyter Notebook • It is an open-source web application that allows you to create and share documents that may contain: – Data cleaning & transformation, – Equations & numerical simulation, – Data visualizations and narrative text. – Machine learning – Deep learning
  • 40. Jupyter Notebook • Project Jupyter is a non-profit, open-source project, born out of the IPython Project in 2014. • It supports over 40 languages. • It can also help us share notebooks. • It gives interactive output. • It also does big data integration.
  • 42. Let’s start writing code… • Download Anaconda from internet. • I have anaconda 4.4.0 (64-bit). • Write ‘Jupyter’ in the search box -> Jupyter Notebook. • It will start and a new tab will open in your default browser. • Click on “New” dropdown box -> Python3
  • 46. Keyboard shortcuts - Jupyter Notebook • Shift + Enter run the current cell, select below • Ctrl + Enter run selected cells • Alt + Enter run the current cell, insert below • Ctrl + S save and checkpoint • Ctrl + ] indent • Ctrl + [ dedent • H show all shortcuts • Z undo cell deletion • S Save and Checkpoint • A insert cell above • B insert cell below • X cut selected cells • C copy selected cells • V paste cells below • Shift + V paste cells above • Y change the cell type to Code • M change the cell type to Markdown
  • 48. Akhil Kaushik akhilkaushik05@gmail.com 9416910303 CONTACT ME AT: Akhil Kaushik akhilkaushik05@gmail.com 9416910303 THANK YOU !!!