0% found this document useful (0 votes)
4 views32 pages

Python Unit 1(Lecture 1)

The document provides an overview of Python programming, detailing its history, features, and applications. Developed by Guido Van Rossum in 1991, Python is an interpreted, high-level, object-oriented language known for its readability and versatility across various domains such as web development, machine learning, and data science. It also highlights the importance of Python libraries, which simplify programming tasks and enhance functionality in numerous fields.

Uploaded by

upasanabishtiitm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views32 pages

Python Unit 1(Lecture 1)

The document provides an overview of Python programming, detailing its history, features, and applications. Developed by Guido Van Rossum in 1991, Python is an interpreted, high-level, object-oriented language known for its readability and versatility across various domains such as web development, machine learning, and data science. It also highlights the importance of Python libraries, which simplify programming tasks and enhance functionality in numerous fields.

Uploaded by

upasanabishtiitm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

Basics of Python

Programming
(UNIT-1)
Lecture-1
Introduction to Python
• Python programming language was developed by Guido Van Rossum in
February 1991.

• Python is based on or influenced with two programming languages:


ABC Language, a teaching language created as a replacement of BASIC.
Modula-3.

• Python is an easy to learn yet powerful object oriented programming


language . It is very high level programming language yet as powerful as
many other middle-level languages(not so high level languages) like C, C+
+,Java etc.
• Python programming language was named after famous BBC Comedy show
namely Monty Python’s Flying Circus

• Though Python language came into being in early 1990’s, yet it is


competing with ever popular languages such as C,C++,Java etc.
What is Python
• Python is an interpreted, object-oriented, high-level programming
language. By "interpreted", we mean that Python code is "not compiled",
instead the Python interpreter turns the source code, line by line, once at
a time, into the machine code when the Python program executes.

• Python's simple, easy to learn syntax emphasizes readability and


therefore reduces the cost of program maintenance.

• Python supports modules and packages, which encourages program


modularity and code reuse.

• Python is a case sensitive programming language.


History of Python
• Python is a very new language; in fact it was released by its designer, Guido
Van Rossum, in February 1991 while working for CWI also known as Centrum
Wiskunde & Informatica.

• Many of Python's features originated from an interpreted language called ABC


.

• Rossum wanted to correct some of ABC's problems and keep some of its
features.

• At the time he was working on the Amoeba distributed operating system


group and was looking for a scripting language with a syntax like ABC but with
the access to the Amoeba system calls, so he decided to create a language
that was generally extensible.
• Since he had some experience with using Modula-2+, he decided to talk with
the designers of Modula-3. Modula-3 is the origin of the syntax and semantics
used for exceptions, and some other Python features.

• In 1989, during the Christmas holidays, he decided to give it a try and design a
language which he later called Python.

• Just in case you're wondering how the language got its name, well it's not from
those dangerous reptiles.

• Python actually got is name from a BBC comedy series from the seventies
"Monty Python's Flying Circus“.

• The designer needed a name that was short, unique, and slightly mysterious.

• Since he was a fan of the show, he thought this name was great.
Guido Van Rossum
Features of Python
• Easy-to-learn: Python has few keywords, simple structure, and a clearly defined
syntax. Due to its simple syntax, you can focus on the logic part rather than the
syntax implementations. This allows us to learn and maintain the code in a
better way.
// In C++: Swap Values
int a = 2 , b = 3 , tmp; a,b =2,3
tmp = 2; a,b =b,a
a = b;
b = tmp ;
• Dynamically typed language: we need not declare the data types of
the variables that they are working with right at the beginning.
It doesn’t know about the type of the variable until the code is run.
So declaration is of no use.

This promotes creative freedom to use variables as they please and


even modify their type later on.
Versatile-It means to be able to adapt or to be used for many different
functions. There are countless domains and scenarios where we use
Python such as Artificial Intelligence, Machine Learning, Data Analysis,
Data Science and Software Engineering.

A broad standard library − Python's vast library set is very helpful in


designing complex applications and solve problems. Some of the most
widely used ones are- Django for building Backend using Python,
PyTorch for Deep Learning, NumPy and Pandas for Data Science,
PyGame for Game Development
• Portable − Python can run on a wide variety of hardware
platforms and has the same interface on all platforms like UNIX,
Windows, and Macintosh.

• Extendable − You can add low-level modules to the Python


interpreter. These modules enable programmers to add to or
customize their tools to be more efficient.

• Databases − Python provides interfaces to all major commercial


databases. It has packages to communicate with SQL, NoSQL etc.
databases ranging from MongoDB to MySQL.
Applications of Python
• Python has been at the forefront of Machine learning, data science, and
artificial intelligence innovation. Some of the Applications of Python are:

• Web Development: It is one of the most astonishing applications of Python.


This is because Python comes up with a wide range of frameworks like Django,
Flask, Bottle, and a lot more that provide ease to developers. Furthermore,
Python has inbuilt libraries and tools which make the web development
process completely effortless. Use of Python for web development also offers:
Amazing visualization
Convenience in development
Enhanced security
Fast development process
• Machine Learning and Artificial Intelligence: Machine Learning
and Artificial Intelligence are the hottest subjects right now.
Python along with its inbuilt libraries and tools facilitate the
development of AI and ML algorithms. Further, it offers simple,
concise, and readable code which makes it easier for developers
to write complex algorithms and provide a versatile flow. Some
of the inbuilt libraries and tools that enhance AI and ML
processes are:
Numpy for complex data analysis
Keras for Machine learning
SciPy for technical computing
Seaborn for data visualization
• Data Science: Data science involves data collection, data sorting, data analysis,
and data visualization. Python provides amazing functionality to tackle statistics
and complex mathematical calculations. The presence of in-built libraries
provides convenience to data science professionals. Some of the popular
libraries that provide ease in the data science process are TensorFlow, Pandas,
and Socket learning. These libraries provide an ecosystem for fine-tuning data
models, data preprocessing, and performing complex data analysis.

• Game Development: With the rapidly growing gaming industry Python has
proved to be an exceptional option for game development. Popular games like
Pirates of the Caribbean, Bridge commander, and Battlefield 2 use Python
programming for a wide range of functionalities and addons. The presence of
popular 2D and 3D gaming libraries like pygame, panda3D, and Cocos2D make
the game development process completely effortless.
• Audio and Visual Applications: Audio and video applications are undoubtedly
the most amazing feature of Python. Python is equipped with a lot of tools and
libraries to accomplish your task flawlessly. Applications that are coded in
Python include popular ones like Netflix, Spotify, and YouTube. This can be
handled by libraries like
Dejavu
Pyo
Mingus
SciPy
OpenCV
• Software Development: Python is just the perfect option for software
development. Popular applications like Google, Netflix, and Reddit all
use Python. This language offers amazing features like:
Platform independence
Inbuilt libraries and frameworks to provide ease of development.
Enhanced code reusability and readability
High compatibility
• Apart from these Python offers enhanced features to work with rapidly
growing technologies like Machine learning and Artificial intelligence. All
these embedded features make it a popular choice for software
development.
• CAD Applications: CAD refers to computer-aided design; it is the
process of creating 3D and 2D models digitally. This application has
replaced manual drift and is used by architects, product designers, and
construction managers to design products with extremely high
consistency. Python is embedded with amazing applications like
Blender, FreeCAD, open cascade, and a lot more to efficiently design
products. These provide enhanced features like technical drawing,
dynamic system development, recordings, file export, and import.
• Business Applications: Python offers excellent security and scalability
features that make it perfect for delivering high-performance business
applications. It has inbuilt libraries and tools like:
Odoo is business management software that provides you with an
automated solution for your business process.
Tryton is easy-to-use open-source business software. It has fully
integrated features like financial accounting, sales, CRM, purchasing,
shipping, and the list goes on.

• Desktop GUI: Python is an interactive programming language that helps


developers to create GUIs easily and efficiently. It has a huge list of
inbuilt tools like PyQT, kivy, wxWidgets, and many other libraries like
them to build a fully functional GUI in an extremely secure and efficient
manner.
Working in Python
• Before you start working in Python, you need to install Python on your
computer. There are multiple Python distributions available.
• Default installation available from www.python.org is called Cpython
installation and comes with Python interpreter, Python IDLE(Python
GUI) and Pip( Package Installer).
• There are many other Python distributions available these days.
Anaconda Python distribution is one such highly recommended
distribution that comes with preloaded with many packages and
libraries(e.g NumPy, SciPy, Panda libraries etc.)
• Many popular IDEs are also available e.g. Spyder IDE, PyCharm IDE etc.
Of these Spyder IDE is already available as a part of Anaconda Python
Distribution.
Python Libraries
• A Python library is a collection of related modules. It contains bundles of
code that can be used repeatedly in different programs. It makes Python
Programming simpler and convenient for the programmer. As we don’t
need to write the same code again and again for different programs.
Python libraries play a very vital role in fields of Machine Learning, Data
Science, Data Visualization, etc.
• Most of the Python Libraries are written in the C programming language.
The Python standard library consists of more than 200 core modules. All
these work together to make Python a high-level programming language.
• Python Standard Library plays a very important role. Without it, the
programmers can’t have access to the functionalities of Python. Some of
the commonly used libraries:
• Tensor Flow: It is an open-source library used for high-level computations.
It is also used in machine learning and deep learning algorithms.
Researchers also use this Python library to solve complex computations in
Mathematics and Physics.
• Matplotlib: This library is responsible for plotting numerical data. And
that’s why it is used in data analysis. It is also an open-source library and
plots high-defined figures like pie charts, histograms, scatterplots,
graphs, etc.
• Pandas: It is an open-source machine learning library that provides
flexible high-level data structures and a variety of analysis tools. It eases
data analysis, data manipulation, and cleaning of data. Pandas support
operations like analysis, cleaning, Sorting, Concatenation, Conversion of
data, Visualizations, Aggregations, etc.
• Numpy: The name “Numpy” stands for “Numerical Python”. It is a
popular machine learning library that supports large matrices and multi-
dimensional data. It consists of in-built mathematical functions for easy
computations. Numpy is very interactive and user friendly.
• SciPy: The name “SciPy” stands for “Scientific Python”. It is an open-
source library used for high-level scientific computations. This library is
built over an extension of Numpy. It works with Numpy to handle
complex computations. While Numpy allows sorting and indexing of
array data, the numerical data code is stored in SciPy. It is also widely
used by application developers and engineers.
• Scrapy: It is an open-source library that is used for extracting data from
websites. It provides very fast web crawling and high-level screen
scraping. It can also be used for data mining and automated testing of
data.
• Scikit-learn: It is a famous Python library to work with complex data.
Scikit-learn is an open-source library that supports machine learning. It
supports variously supervised and unsupervised algorithms like linear
regression, classification, clustering, etc. This library works in association
with Numpy and SciPy.
• PyGame: This library provides an easy interface to the Standard
Directmedia Library (SDL) platform-independent graphics, audio, and
input libraries. It is used for developing video games using computer
graphics and audio libraries along with Python programming language.
Pygame was officially written by Pete Shinners.
• PyTorch: PyTorch is the largest machine learning library that optimizes
tensor (Tensors are a type of data structure used in linear algebra, and
like vectors and matrices) computations. It has rich APIs to perform
tensor computations with strong GPU acceleration. It also helps to solve
application issues related to neural networks. Graphs can be set up
dynamically and computed dynamically at any point during code
execution in PyTorch. In PyTorch, coding is simple and processing is quick.
• PyBrain: The name “PyBrain” stands for Python Based Reinforcement
Learning, Artificial Intelligence, and Neural Networks library. It is an open-
source library built for beginners in the field of Machine Learning. It
provides fast and easy-to-use algorithms for machine learning tasks. It is
so flexible and easily understandable and that’s why is really helpful for
developers that are new in research fields.
• Keras: Keras is a Python-based open-source neural network library that
lets us experiment with deep neural networks quickly. With deep
learning becoming more common, Keras emerges as a great option
because, according to the creators, it is an API (Application Programming
Interface) designed for humans, not machines.

You might also like