SlideShare a Scribd company logo
BASICS OF
PYTHON
What is Python..?
• Python is a general purpose programming 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
Difference Between Program and scripting language
Program
• A program is executed (i.e. the
source is first compiled, and the
result of that compilation is
expected)
• A program in general, is a sequence
of instructions written so that a
computer can perform certain task.
Scripting
• A script is interpreted.
• A script is code written in a scripting
language. A scripting language is
nothing but a type of programming
language in which we can write code
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.
Scope of Python
Science
- Bioinformatics.
System Administration
-Unix
-Web logic
-Web sphere
Web Application Development
-CGI
-Jython – Servlets
Testing scripts
What can I do with Python…?
• System
programming.
• Graphical User
Interface
Programming
• Internet Scripting
• Component
Integration
• Database
Programming
• Gaming, Images,
XML , Robot and
more.
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.
 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.
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
Python Code Execution
 Python’s traditional runtime
execution model: source code you
type is translated to byte code,
which is then run by the Python
Virtual Machine. Your code is
automatically compiled, but then
it is interpreted.
 Source code extension is .py
Byte code extension is .pyc
(compiled python code)
Running Python
 Once you're inside the Python interpreter, type in
commands at will.
 Examples:
>>> print 'Hello world’
Hello world
# Relevant output is displayed on subsequent lines
without the >>> symbol
>>> x = [0,1,2]
# Quantities stored in memory are not displayed by
default
>>> x
# If a quantity is stored in memory, typing its name
will display it [0,1,2]
>>> 2+3
5
A Sample Code
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
THANK YOU

More Related Content

PPTX
Introduction to python for Beginners
PDF
intro.pptx (1).pdf
PPTX
Introduction python
PPTX
Python Tutorial | Python Programming Language
PPTX
Phython Programming Language
PPTX
python programminig and introduction.pptx
PPTX
Python tutorial for beginners - Tib academy
PPTX
introduction to python in computer graphics.pptx
Introduction to python for Beginners
intro.pptx (1).pdf
Introduction python
Python Tutorial | Python Programming Language
Phython Programming Language
python programminig and introduction.pptx
Python tutorial for beginners - Tib academy
introduction to python in computer graphics.pptx

Similar to Python is a high-level, interpreted programming language known for its simplicity and readability. (20)

PPTX
introduction to python in detail including .pptx
PPTX
Python Programming Draft PPT.pptx
PDF
Python Programing Bio computing,basic concepts lab,,
PPTX
PYTHON FEATURES.pptx
PDF
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
PPT
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
PPT
Python programming-2-2048 (30 files merged).ppt
PPT
Python programming notes all in one python ppt
PPT
program on python what is python where it was started by whom started
PPT
Python Over View (Python for mobile app Devt)1.ppt
PPT
Py-Slides-1.ppt1234444444444444444444444444444444444444444
PPT
Python slides for the beginners to learn
PPT
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
DOCX
Seminar report on python 3 course
PDF
python-160403194316.pdf
PPTX
Python Seminar PPT
PPTX
Python
PPTX
Python programming language introduction unit
PDF
Python Programming Part 1.pdf
PDF
Python Programming Part 1.pdf
introduction to python in detail including .pptx
Python Programming Draft PPT.pptx
Python Programing Bio computing,basic concepts lab,,
PYTHON FEATURES.pptx
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Python programming-2-2048 (30 files merged).ppt
Python programming notes all in one python ppt
program on python what is python where it was started by whom started
Python Over View (Python for mobile app Devt)1.ppt
Py-Slides-1.ppt1234444444444444444444444444444444444444444
Python slides for the beginners to learn
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Seminar report on python 3 course
python-160403194316.pdf
Python Seminar PPT
Python
Python programming language introduction unit
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Ad

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Business Ethics Teaching Materials for college
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Classroom Observation Tools for Teachers
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
master seminar digital applications in india
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Pharma ospi slides which help in ospi learning
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Cell Structure & Organelles in detailed.
PPTX
Institutional Correction lecture only . . .
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
human mycosis Human fungal infections are called human mycosis..pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Business Ethics Teaching Materials for college
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Basic Mud Logging Guide for educational purpose
Classroom Observation Tools for Teachers
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Supply Chain Operations Speaking Notes -ICLT Program
PPH.pptx obstetrics and gynecology in nursing
Anesthesia in Laparoscopic Surgery in India
O7-L3 Supply Chain Operations - ICLT Program
master seminar digital applications in india
Complications of Minimal Access Surgery at WLH
Pharma ospi slides which help in ospi learning
Module 4: Burden of Disease Tutorial Slides S2 2025
Week 4 Term 3 Study Techniques revisited.pptx
Cell Structure & Organelles in detailed.
Institutional Correction lecture only . . .
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Ad

Python is a high-level, interpreted programming language known for its simplicity and readability.

  • 2. What is Python..? • Python is a general purpose programming 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
  • 3. Difference Between Program and scripting language Program • A program is executed (i.e. the source is first compiled, and the result of that compilation is expected) • A program in general, is a sequence of instructions written so that a computer can perform certain task. Scripting • A script is interpreted. • A script is code written in a scripting language. A scripting language is nothing but a type of programming language in which we can write code to control another software application.
  • 4. 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.
  • 5. Scope of Python Science - Bioinformatics. System Administration -Unix -Web logic -Web sphere Web Application Development -CGI -Jython – Servlets Testing scripts
  • 6. What can I do with Python…? • System programming. • Graphical User Interface Programming • Internet Scripting • Component Integration • Database Programming • Gaming, Images, XML , Robot and more.
  • 7. 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.  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.
  • 8. 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
  • 9. Python Code Execution  Python’s traditional runtime execution model: source code you type is translated to byte code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then it is interpreted.  Source code extension is .py Byte code extension is .pyc (compiled python code)
  • 10. Running Python  Once you're inside the Python interpreter, type in commands at will.  Examples: >>> print 'Hello world’ Hello world # Relevant output is displayed on subsequent lines without the >>> symbol >>> x = [0,1,2] # Quantities stored in memory are not displayed by default >>> x # If a quantity is stored in memory, typing its name will display it [0,1,2] >>> 2+3 5
  • 11. A Sample Code 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