0 ratings 0% found this document useful (0 votes) 37 views 22 pages 2.introduction For Python
Python, developed by Guido van Rossum in the late 1980s, supports multiple programming paradigms and is known for its dynamic typing and readability. The language has evolved through various editions, with Python 3.x being the current focus, while Python 2.x support ended in 2020. It is widely used in data science and offers various Integrated Development Environments (IDEs) like PyCharm and Jupyter Notebook, which provide tools for coding, debugging, and version control.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Carousel Previous Carousel Next
Save 2.introduction for python For Later Evolution of Python
«Python was developed by Guido van Rossum in the late
eighties at the ‘National Research Institute for Mathematics
and Computer Science’ at Netherlands
+ Python Editions
Python 1.0
Python 2.0
Python 3.0Python as a programming language
+» Supports multiple programming paradigm
» Functional, Structural, OOPs, etc.
+ Dynamic typing
> Runtime type safety checks
« Reference counts
Deallocates objects which are not used for long
+ Late binding
» Methods are looked up by name during runtime
« Python's design is guided by 20 aphorisms as described in Zen of
Python by Tim PetersPython as a programming language
Standard CPython interpreter is managed by “Python Software
Foundation”
There are other interpreters namely JPython (Java), Iron, Python
(C#), Stackless Python (C, used for parallelism), PyPy (Python
itself JIT compilation)
Standard libraries are written in python itself
High standards of readabilityPython as a programming language
+ Cross-platform (Windows, Linux, Mac)
Highly supported by a large community group
« Better error handlePython as a programming language
» Comparison to Java
+ Python vs Java
> Java is statically typed i.e. type safety is checked during compilation
(static compilation)
» Thus in Java the time required to develop the code is more
© Python which is dynamically typed compensates for huge
compilation time when compared to Java
© Codes which are dynamically typed tend to be less verbose
therefore offering more readabilityAdvantages of using python
+ Python has several features that make it well suited for data
science
+ Open source and community development
° Developed under Open Source Initiative license making it free to use
and distribute even commercially
+ Syntax used is simple to understand and code
+ Libraries designed for specific data science tasks
» Combines well with majority of the cloud platform service
providersCoding environment
+ A software program can be written using a terminal, a
command prompt (cmd), a text editor or through an Integrated
Development Environment (IDE)
+ The program needs to be saved in a file with an appropriate
extension (.py for python, .mat for matlab, etc...) and can be
executed in corresponding environment (Python, Matlab, etc...)
+ Integrated Development Environment (IDE) is a software
product solely developed to support software development in
various or specific programming language(s)Coding environment
Python 2.x support will be available till 2020
Python 3.x is an enhanced version of 2.x and will only be maintained
from 3.6.x post 2020
Install basic python version or use the online python console as in
https://www. hon.or;
Execute following commands and view the outputs in terminal or
command prompt
© Basic print statement
» Naming conventions for variables and functions, operators
* Conditional operations, looping statements (nested)
» Function declaration and calling
© Installing moduleseee — >
Te
>>> printChellow world! !")
Sea ee
Sera
5S
cerca
Perens
le + 8="4b)
Loe
Re cr me
roerarta arias muetsxc3})
ssignment operator = “sstr(b))
Sra Clea
Bae)
spans
Sem TIC)
ape hee
ry ooa Deed Pere) eT a Coc
eo
eC
Raromriars
>>> type(c)
Rareoma iia
Sn)
es
Soaiwra
ad
eee es
False
a ae
Ges
Saeed
False
>>> b>c or ab
True
a ae)
GainsIntegrated development environment (IDE)
Software application consisting of a cohesive unit of tools
required for development
+ Designed to simplify software development
Utilities provided by IDEs include tools for managing, compiling,
deploying and debugging softwareCoding environment- IDE
+ An IDE usually comprises of
- Source code editor
Compiler
- Debugger
Additional features include syntax and error highlighting,
code completion
+ Offers supports in building and executing the program along
with debugging the code from within the environmentCoding environment- IDE
+ Best IDEs provide version control features
+ Eclipse+PyDey, SublimeText, Atom, GNU Emacs, Vi/Vim, Visual
Studio, Visual Studio Code are general IDEs with python
support
* Apart from these some of the python specific editors include
Pycharm, Jupyter, Spyder, ThonnySpyder
+ Supported across Linux, Mac OS X and Windows platforms
+ Available as open source version
+ Can be installed separately or through Anaconda distribution
+ Developed for Python and specifically data science
» Features include
» Code editor with robust syntax and error highlighting
> Code completion and navigation
> Debugger
° Integrated document.
+ Interface similar to MATLAB and RStudioPyCharm
+ Supported across Linux, Mac OS X and Windows platforms
+ Available as community (free open source) and professional (paid) version
+ Supports only Python
+ Can be installed separately or through Anaconda distribution
+ Features include
~ Code editor provides syntax and error highlighting
> Code completion and navigation
> Unit testing
Debugger
> Version controlJupyter Notebook
*Web application that allows creation and manipulation of
documents called ‘notebook’
+» Supported across Linux, Mac OS X and Windows platforms
+ Available as open source versionJupyter NotebookJupyter Notebook
+ Bundled with Anaconda
distribution or can be installed
separately
+ Supports: Julia, Python, R and
Scala
+ Consists of ordered collection of
input and output cells that contain
code, text, plots etc.Jupyter Notebook
«Allows sharing of code and
narrative text through output
formats like PDF HTML etc.
» Education and presentation
tool
Lacks most of the features of
a good IDEHow to choose the best IDE?
+ Requirements
+ Working with different IDEs helps us understand our own
requirement