Introduction To Python

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Module-1

Introduction to Python Programming


Language
Agenda
 What is Python?
• Difference between programming and scripting language?
• History of python
 Why Python?
• Features of python
 Where Python?
• Applications of Python
 Installing Python IDE
WHAT IS PYTHON ?

Python is a High-Level Dynamic Programming Language which is


interpreted

• Python is a popular programming language.


• General Purpose Language
• High-Level Language
• Dynamic Language
• Interpreted Language
DIFFERENCE BETWEEN
PROGRAMMING AND SCRIPTING
LANGUAGE
Program Scripting
• a program is executed (i.e. the • a script is interpreted
source is first compiled, and the
result of that compilation is • A "script" is code written in a
expected) scripting language. A scripting
language is nothing but a type of
• A "program" in general, is a programming language in
sequence of instructions written which we can write code to
so that a computer can perform control
another software application.
certain task.
Python’s Benevolent Dictator For Life

“Python is an experiment in how much


freedom programmers need. Too much
freedom and nobody can read
another's code; too little“.

- Guido van Rossum


HISTORY
Guido van Rossum invented Python in the Netherlands in early 90s the father of
Python had simple goals in mind when he was developing it, easy looking code,
readable and open source.

• Python is ranked as the 3rd most prominent language followed by JavaScript and Java in a
survey held in 2023 by Stack Overflow which serves as proof to it being the most growing
language
• The implementation of Python was started in December 1989 by Guido Van Rossum at CWI
in Netherlands.
• In February 1991, van Rossum published the code (labeled version 0.9.0).
• In 1994, Python 1.0 was released with new features like: lambda, map, filter, and reduce.
• Python 2.0 added new features like list comprehensions, and garbage collection system.
• On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to
rectify the fundamental flaw of the language.
• ABC programming language is said to be the predecessor of Python language which was
capable of Exception Handling and interfacing with Amoeba Operating System.

Why the name Python?


It isn't the name of a dangerous snake python. Rossum was a fan of a comedy series from late
seventies. The name "Python" was adopted from the same series "Monty Python's Flying
Circus".

Why Python?
Features of Python
1) Easy to Learn and Use
Python is easy to learn as compared to other programming languages. Its syntax is
straightforward and much the same as the English language. There is no use of the semicolon
or curly-bracket, the indentation defines the code block. It is the recommended programming
language for beginners.

2) Expressive Language
Python can perform complex tasks using a few lines of code. A simple example, the hello world
program you simply type print("Hello World"). It will take only one line to execute, while Java
or C takes multiple lines.
C++ Syntax Java Python:

#include <iostream> public class Main {


using namespace std; public static void main(String[] print("Hello, World!")
int main() { args) {

cout << "Hello System.out.println("Hello


World!"; World");
return 0; Output:
}
} Hello, World!
}
3) Interpreted Language
Python is an interpreted language; it means the Python program is executed one line at a time.
The advantage of being interpreted language, it makes debugging easy and portable.

4) Cross-platform Language
Python can run equally on different platforms such as Windows, Linux, UNIX, and Macintosh, etc.
So, we can say that Python is a portable language. It enables programmers to develop the
software for several competing platforms by writing a program only once.

5) Free and Open Source


Python is freely available for everyone. It is freely available on its official website
www.python.org. It has a large community across the world that is dedicatedly working towards
make new python modules and functions. Anyone can contribute to the Python community. The
open-source means, "Anyone can download its source code without paying any penny."
6) Object-Oriented Language

Python supports object-oriented language and concepts of classes and objects come into existence. It supports
inheritance, polymorphism, and encapsulation, etc. The object-oriented procedure helps to programmer to
write reusable code and develop applications in less code.

7) Large Standard Library

It provides a vast range of libraries for the various fields such as machine learning, web developer, and also for
the scripting. There are various machine learning libraries, such as Tensor flow, Pandas, Numpy, Keras, and
Pytorch, etc. Django, flask, pyramids are the popular framework for Python web development.

8) Integrated

It can be easily integrated with languages like C, C++, and JAVA, etc. Python runs code line by line like C,C++
Java. It makes it easy to debug the code.

9) Dynamic Memory Allocation

In Python, we don't need to specify the data-type of the variable. When we assign some value to the variable, it
automatically allocates the memory to the variable at run time. Suppose we are assigned integer value 15 to x,
then we don't need to write int x = 15. Just write x = 15.
Where?
Scope of Python
Understanding what is Python and features, you would wonder what can you do when you
master it. Well, the list is just surprisingly long. For instance,

• Creating web applications with Python • Data Analytics


Frameworks such as Django and Flask
• App development
• Web Development
• Hacking
• Software Testing

• Machine Learning

• Artificial Intelligence

• Data Science
Python gave birth to
• Google used python on backend.
• YouTube, the popular video-sharing website on
backend.
• Facebook- python and php on backend.
• Instagram is a free photo sharing application.
• Pinterest is a social bookmarking site, Pinterest is
written with Django, a web application framework that
uses the Python programming language.
• Dropbox is a cloud storage provider that is
frequently used as a fle-sharing service.
Real-world Applications of Python

1. Web Development

When it comes to web development, Python should be your go-to tool. Why?

That’s because Python offers numerous options for web development. For instance, you have
Django, Pyramid, Flask, and Bottle for developing web frameworks and even advanced content
management systems like Plone and Django CMS. These web frameworks are packed with
standard libraries and modules which simplify tasks like content management, database
interaction, and interfacing with internet protocols like HTTP, SMTP, XML, JSON, FTP, IMAP, and
POP.
2. Game Development

Python comes loaded with many useful extensions (libraries) that come in handy for the
development of interactive games. For instance, libraries like PySoy (a 3D game engine
that supports Python 3) and PyGame are two Python-based libraries used widely for
game development. Python is the foundation for popular games like Battlefield 2, Frets on
Fire, World of Tanks, Disney’s Toontown Online, Vega Strike, and Civilization-IV.

Apart from game development, game designers can also use Python for developing tools
to simplify specific actions such as level design or dialog tree creation, and even use
those tools to export those tasks in formats that can be used by the primary game engine.
Also, Python is used as a scripting language by many game engines.
3. Scientific and Numeric Applications

Thanks to its massive library base, Python has become a crucial tool in scientific and numeric computing. In
fact, Python provides the skeleton for applications that deal with computation and scientific data processing.
Apps like FreeCAD (3D modeling software) and Abaqus (finite element method software) are coded in
Python.

Some of the most useful Python packages for scientific and numeric computation include:

● SciPy (scientific numeric library)

● Pandas (data analytics library)

● IPython (command shell)

● Numeric Python (fundamental numeric package)


1. NASA
The National Aeronautics and Space Administration uses Workflow Automation System (WAS), an application written and developed in
Python. It was developed by NASA’s shuttle-support contractor USA (United Space Alliance).

NASA also uses Python for APOD (Astronomy Picture Of the Day), API, PyTransit, PyMDP Toolbox, EVEREST.

2. Google
Who, on this Earth, lives and doesn’t know Google? We use it for everything – sometimes, even to find answers to life’s deepest questions.
Google uses Python for its internal systems, and its APIs for report-generation, log analysis, A/Q and testing, and writing core search-
algorithms.

3. IBM
An American multinational technology company headquartered in New York, IBM uses Python for its factory tool control applications.

4. Yahoo! Maps
Maps is an online mapping portal by Yahoo! It uses Python in many of its mapping lookup services and addresses.

5. Walt Disney Feature Animation


WDFA uses Python as a scripting language for animation. All the magic that happens in Disneyland has a bit of Python behind it.
Advantages of Python

1.Easy to use and learn

2.Increased productivity

3.Extensive library

4.Supportive community
Disadvantages of Python

1. Speed

2. Memory Consumption

3. Simplicity

4. Mobile Development and Game Development: Python can be used for mobile app
development but it's not as common as languages like Java, Kotlin (for Android), or Swift (for
iOS). The ecosystem and performance might not be as robust for mobile development compared
to these languages. While there are tools and frameworks available, Python is not as commonly
used as languages like Java or C in the mobile gaming industry.
INSTALLING PYTHON
Python is pre-installed on most of Unix/ Linux as well as Mac OS X.
Now for windows:-
 user can download from the https://www.python.org/downloads/
- from the above link download latest version of python IDE and install
Or
Go To GOOGLE.com >> Search “python Download”.

Click
on it
INSTALLING PYTHON

Click on
Download &
install
AFTER INSTALLATION

Interactive mode Script mode


INTERACTIVE MODE

Math(Operators) in idle[IDLE :- Integrated Development and Learning


Environment.]
NEXT TOPIC :- DATA TYPES,INPUT,OPERATIONS

You might also like