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
PPTX
Python Tutorial | Python Programming Language
PPTX
Introduction python
PPTX
python programminig and introduction.pptx
PPTX
introduction to python in computer graphics.pptx
PPTX
Python tutorial for beginners - Tib academy
PPTX
Python Programming Draft PPT.pptx
PDF
intro.pptx (1).pdf
Introduction to python for Beginners
Python Tutorial | Python Programming Language
Introduction python
python programminig and introduction.pptx
introduction to python in computer graphics.pptx
Python tutorial for beginners - Tib academy
Python Programming Draft PPT.pptx
intro.pptx (1).pdf

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

PPTX
Phython Programming Language
PPTX
introduction to python in detail including .pptx
PPTX
PYTHON FEATURES.pptx
PPTX
Introduction to the Python
PPTX
Presentation on python
PDF
session5-Getting stated with Python.pdf
PDF
Introduction to Python Unit -1 Part .pdf
PPT
1-ppt-python.ppt
PDF
Learning python in a cool and fun way-Module-1.1.pdf
PPTX
Python_Introduction_Good_PPT.pptx
PPT
Python for students step by step guidance
PDF
Python Programming Part 1.pdf
PDF
Python Programming Part 1.pdf
PDF
Python Programming Part 1.pdf
PPTX
DSA Presentation.pptx pptttttttttttttttt
PPTX
Welcome_to_Python.pptx
PPTX
Welcome_to_Python_programming_language.pptx
PPTX
python unit2.pptx
PPTX
Chapter - 1.pptx
PPTX
Introduction to Python – Learn Python Programming.pptx
Phython Programming Language
introduction to python in detail including .pptx
PYTHON FEATURES.pptx
Introduction to the Python
Presentation on python
session5-Getting stated with Python.pdf
Introduction to Python Unit -1 Part .pdf
1-ppt-python.ppt
Learning python in a cool and fun way-Module-1.1.pdf
Python_Introduction_Good_PPT.pptx
Python for students step by step guidance
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python Programming Part 1.pdf
DSA Presentation.pptx pptttttttttttttttt
Welcome_to_Python.pptx
Welcome_to_Python_programming_language.pptx
python unit2.pptx
Chapter - 1.pptx
Introduction to Python – Learn Python Programming.pptx
Ad

Recently uploaded (20)

PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Cell Structure & Organelles in detailed.
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Cell Types and Its function , kingdom of life
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Lesson notes of climatology university.
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
VCE English Exam - Section C Student Revision Booklet
Microbial disease of the cardiovascular and lymphatic systems
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Anesthesia in Laparoscopic Surgery in India
Cell Structure & Organelles in detailed.
Supply Chain Operations Speaking Notes -ICLT Program
Computing-Curriculum for Schools in Ghana
Cell Types and Its function , kingdom of life
Final Presentation General Medicine 03-08-2024.pptx
01-Introduction-to-Information-Management.pdf
Lesson notes of climatology university.
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
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