0% found this document useful (0 votes)
3 views21 pages

Python-1- Introduction to Python

The document provides an overview of Python, highlighting its dual nature as both a programming and scripting language, its history, and its applications across various fields. It discusses the differences between programming and scripting languages, the reasons for Python's popularity, and how to install it on different operating systems. Additionally, it includes a sample code snippet to illustrate Python's syntax and features.

Uploaded by

lemniscatetools
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
3 views21 pages

Python-1- Introduction to Python

The document provides an overview of Python, highlighting its dual nature as both a programming and scripting language, its history, and its applications across various fields. It discusses the differences between programming and scripting languages, the reasons for Python's popularity, and how to install it on different operating systems. Additionally, it includes a sample code snippet to illustrate Python's syntax and features.

Uploaded by

lemniscatetools
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 21

Jai Mishra

Official.jaikrishnamishra
@gmail.com
Agenda
What is Python…?
Differences between program and scripting language
History of Python
Scope of Python
Why do people use Python?
Installing Python IDE
Who uses python today
What can I do with python
A Sample Code
Python code execution
Running Python
What is Python…?
Python is a general purposeprogramming language that
is often applied in scripting roles.
So, Python is programming language as well as scripting
language.
Python is also called as Interpreted language
What’s the difference between Scripting and Programming Languages?
• Basically, all scripting languages are programming languages.

• The theoretical difference between the two is that scripting languages do not
require the compilation step and are rather interpreted.

• For example, normally, a C program needs to be compiled before running whereas


normally, a scripting language like JavaScript or PHP need not be compiled.

• Generally, compiled programs run faster than interpreted programs because they
are first converted native machine code.

• Also, compilers read and analyze the code only once, and report the errors
collectively that the code might have, but the interpreter will read and analyze the
code statements each time it meets them and halts at that very instance if there is
some error.

• In practice, the distinction between the two is getting blurred owing to improved
computation capabilities of the modern hardware and advanced coding practices.
Differences between program and
scripting language
Program Scripting
a program is executed (i.e. a script is interpreted
the source is first compiled, A "script" is code written in
and the result of that a scripting language. A
compilation is expected) scripting language is
A "program" in general, is a nothing but a type of
sequence of instructions programming language in
written so that a computer which we can write code
can perform certain task. to control
another software
application.
History
Invented in the Netherlands, early 90s by Guido van Rossum
Python was conceived in the late 1980s and its
implementation was started in December 1989
Guido Van Rossum is fan of ‘Monty Python’s Flying
Circus’, this is a famous TV show in Netherlands
Named after Monty Python
Open sourced from the beginning
Python’s Benevolent Dictator For Life

“Python is an experiment in how much


freedom program-mers need. Too much
freedom and nobody can read another's
code; too little and expressive-ness is
endangered.”
- Guido van Rossum
Why was python created?
"My original motivation for creating Python
was the perceived need for a higher level
language in the Amoeba [Operating Systems]
project.
I
administration realized
utilities in that C lon
Moreover, was the
takingdevelopment
doingthese things
too in g.
the
wouldn't Bourne
work of
for a variety system
of reasons. ... she
So, therewas a need for lla
language that would bridge the gap
between C and the shell”
- Guido Van
Rossum
Scope of Python

• IOT
-Coding in Development Boards(RPi)
• System Administration
-Unix
• Web Application Development
-UI with Tkinter
• Machine Learning
• Software and Website Backend
-Django
Why do people use Python…?
The following primary factors cited by Python users
seem to be these:
Python is object-oriented
Structure supports such concepts as polymorphism, operation
overloading, and multiple inheritance.
Indentation
Indentation is one of the greatest future in Python.
It's free (open source)
Downloading and installing Python is free and easy
Source code is easily accessible
It's powerful
-Dynamic typing
- Built-in types and tools
- Library utilities
- Third party utilities (e.g. Numeric, NumPy, SciPy)
-Automatic memory management
It's portable
-Python runs virtually every major
platform used today
-As long as you have a compatible Python interpreter installed,
Python programs will run in exactly the same manner,
irrespective of platform.
It's mixable
- Python can be linked to components written in other languages easily
- Linking to fast, compiled code is useful to computationally
intensive
problems
- - Python/C
integration is
quite
common
It's easy to use
- No
intermediat
e compile
and link
steps as in
C/ C++
- Python programs are compiled automatically to an
What's the difference between ASCII and Unicode?

• ASCII defines 128 characters, which map to the numbers 0–127.

• Unicode defines (less than) 221characters, which, similarly, map to


numbers 0–221 (though not all numbers are currently assigned, and some
are reserved).

• Unicode is a superset of ASCII, and the numbers 0–127 have the same
meaning in ASCII as they have in Unicode. For example, the number 65
means "Latin capital 'A'".
Installing Python
Python is pre-installed on most Unix systems,
including Linux and MAC OS X

But for in Windows Operating Systems , user can


download from the https://www.python.org/downloads/
- from the above link download latest version of
python IDE and install, recent version is 3.4.1 but
most of them uses version 2.7.7 only
After installing the
Python Ver#2.7.7, go to
start menu then click on
python 2.7 in that one
you can select python
(command line) it is
prompt with >>>
Who uses python today…
Python is being applied in real revenue-generating products
by real companies. For instance:
Google makes extensive use of Python in its web search
system, and employs Python’s creator.
Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM
use Python for hardware testing.
ESRI uses Python as an end-user customization tool for
its popular GIS mapping products.
The YouTube video sharing service is largely written
in Python
What can I do with Python…?
System programming
Graphical User Interface Programming
Internet Scripting
Component Integration
Database
Programming
Gaming, Images, XML
, Robot and more
A Sample Code(Python 3)
x = 34 - 23 # A comment.
y = “Hello” # Another one.
z = 3.45
if z == 3.45 or y == “Hello”:
x=x+1
y = y + “ World” # String concat.
print (x)
print (y)
Answer for Python 3
Enough to understand the code
Indentation matters to code meaning
-Block structure indicated by indentation
First assignment to a variable creates it
- Variable types don’t need to be declared.
-Python figures out the variable types on its own.
Assignment is = and comparison is ==
For numbers + - * / % are as expected
- Special use of + for string concatenation and % for string
formatting (as in C’s printf)
Logical operators are words (and, or, not) not symbols
The basic printing command is print

You might also like