Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Python

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

What is Python?

• Python is a popular programming language. It was created by Guido


van Rossum, and released in 1991.
• It is used for:
• web development (server-side),
• software development,
• mathematics,
• system scripting.
What is Python?

Python is one of the most popular and fastest growing programming languages in
the world.

Created in the early 1990s

It's used for all sorts of tasks, including web programming and data analysis, and it
has emerged as the language to learn for machine learning.

That popularity means Python developers are in demand, and Python


programming jobs can be lucrative

The above-mentioned reasons are why it might be a good idea for you to learn how
to program in Python.
Why Python?
• Python has a simple, easy to learn syntax, which emphasizes readability.
Applications written in Python can run on almost any computer,
including those running Windows, macOS, and popular distributions of
Linux. Furthermore, the ecosystem contains a rich set of development
tools for writing, debugging, and publishing Python applications.

• Python because of its rich and easy to understand syntax and the
wide range of open-source packages available. Packages are shared
code libraries that are freely available for anyone to use.
Why Python?

• Python works on different platforms (Windows, Mac, Linux, Raspberry


Pi, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can be
very quick.
• Python can be treated in a procedural way, an object-oriented way or
a functional way.
What can Python do?
• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and modify
files.
• Python can be used to handle big data and perform complex
mathematics.
• Python can be used for rapid prototyping, or for production-ready
software development.
History of Python
• The Implementation of Python was started in the December 1989 by Guido Van
Rossum at National Research Institute in Netherland.
• In February 1991 Van Rossum Published the code.
• In 1994. Python 1.0 was released with new features like lambda, map, filter and
reduce.
• Python 2.0 added new features like, comprehensions, garbage collection system.
• On December 3, 2008 Python 3.0(also called ‘PY3K’) was released.
• ABC Programming language is said to be the predecessor of Python language which
was capable of Exception Handling and interfacing with Amoeba Operating System.
• Python is influenced by following programming languages.
• ABC Language
• Modula-3
Features of PYTHON
• Easy to Learn and use
• Python is easy to learn and use. It is developer friendly and high level programming language
• Expressive Language
• Python Language is more expressive means that is more understandable and readable.
• Interpreted Language
• Python is an interpreted language i.e., Interpreter executes the code line by line at a time. This
makes debugging easy and its suitable for beginners.
• Cross Platform Language
• Python can run equally on different plat forms such as windows Linux, Unix and macintosh etc.,
So we can say python is portable language.
• Free and Open Source
• Python language is freely available at official address www.python.org/downloads.
• The source-code is also available. Therefore, it is open source.
Features of PYTHON
• Easy to Learn and use
• Python is easy to learn and use. It is developer friendly and high level programming language
• Expressive Language
• Python Language is more expressive means that is more understandable and readable.
• Interpreted Language
• Python is an interpreted language i.e., Interpreter executes the code line by line at a time.
This makes debugging easy and its suitable for beginners.
• Cross Platform Language
• Python can run equally on different plat forms such as windows Linux, Unix and macintosh
etc., So we can say python is portable language.
• Free and Open Source
• Python language is freely available at official address www.python.org/downloads.
• The source-code is also available. Therefore, it is open source.
Features of PYTHON
• Object-oriented Language
• Python supports object-oriented language and concepts of classes and objects come into
existence.
• Expressive Language
• It implies that other languages such as C/C ++ can be used to compile the code and thus it
can be used further in our python code.
• Large standard Library
• Python has a large and broad library and provides rich set of module and functions for
rapid application development.
• GUI Programming Support
• Graphical User Interfaces can be developed using Python.
• Integrated
It can be easily integrated with languages like C,C++ and Java etc.
Applications of Python.
• Web Applications.

• Desktop GUI applications

• Network Programming

• Gaming Applications

• Data Analysis Application

• Console Based Applications

• Business Applications.

• Audio and Video Based applications.


Running a Code in Python
• Python is an interpreted language, which reduces the edit-test-debug
cycle because there's no compilation step required. In order to run
Python apps, you need a runtime environment/interpreter to execute
the code.
Interactive mode: In this mode, each command you type is interpreted and executed immediately,
and you see the results each time you press ENTER. The interactive mode is the default mode if you
don't pass a filename to the interpreter.

Script mode: In script mode, you put a set of Python statements into a text file with a .py
extension. You then run the python interpreter and point it at the file. The program is executed line
by line, and the output is displayed. There's no compilation step, as shown in the following diagram :
Different ways to Execute Python
Code
Interactive mode: In this mode, each command you type is interpreted and executed immediately,
and you see the results each time you press ENTER. The interactive mode is the default mode if you
don't pass a filename to the interpreter.

Script mode: In script mode, you put a set of Python statements into a text file with a .py
extension. You then run the python interpreter and point it at the file. The program is executed line
by line, and the output is displayed. There's no compilation step, as shown in the following diagram :

Using Python IDLE


Using PyCharm Editor
Interpreter Vs Compiler
Interpreter Compiler

It will check line by line and execute. It will check whole program at a time
It gives the results line by line It gives whole output at a time
If any error occurs interpreter stops. It checks all statements in the
Hence it shows only one error program and show all errors in
program
It will not generate executable file If no errors in the program, then it
generates executable file
It always execute only source code. It executes exe file.
Ex HTML, PERL, Javascript, Python EX. C,C++,C#, JAVA
Steps to install Python for Windows
• Go to Google

• Type Python Download for Windows

• Click on Python.org

• Click on Download Python 3.10.0

• It will be downloaded Python 3.10.0 Exe

• Open Python 3.10.0 Exe

• Activate the checkbox Add Python Path

• Click on Install now

• Click on Next, Next, Install.


Python Indentation.
• Most of the programming languages like C, C++, Java uses braces() to define a block of code
but python uses indentation.
• A code block(body of a function, loop etc.,)start with indentation and ends with the first un-
indented line. The amount of indentation is up to you, but it most be consistent throughout
that block.
• Generally, four whitespaces are used for indentation and is preferred over tabs.
• The indentation in Python makes the code look neat and clean.
• Indentation can be ignored in line continuation.
• But it makes the code more readable.
• Ex : a=10
if a==10;
print(“true”)

You might also like