SlideShare a Scribd company logo
Components of Python
Program
Swipe
Components of any Python Program are as below:-
Components of Python Program
Python
Suite
Comments
Statement
Blocks and
Indentations
Literals
Constants
Identifiers
Variables
reserved
words
Expression
An expression is a combination of values, variables,
operators and call-to-functions.
Expressions need to be evaluated.
If you use print function for an expression then it
evaluates the expressions and prints the result.
Expression generally evaluates to a value, which is why
expression is written on the right hand side in an
assignment statement.
A single value itself is a simple expression.
Expressions in Python
Python expressions only contain identifiers,
literals, and operators. some of those operators
are:-
Token
Operator
How to create an expression?
add
subtract
multiply
power
Integer Division
remainder
decorator
+
-
*
**
/
%
@
An escape sequence consists of a special
character, such as backslash(), followed by a
required character.
Whitespace is represented by these characters.
Whitespace gives characters like space, tab,
formfeed, vertical tab.
Escape sequence in python
Few important escape sequences are mentioned
as below:-
Escape sequence Escape sequence


n
t
v
1.
2.
3.
4.
5.
6.
write a single line string
into multi line string
To print 
new line
Horizontal tab
Vertical tab
Escape sequence in python
Data Types in Python
Mutable vs Immutable Data
type in Python
Stay Tuned with
Topics for next Post

More Related Content

What's hot

Templates in C++
Templates in C++Templates in C++
Templates in C++
Tech_MX
 

What's hot (20)

functions in C and types
functions in C and typesfunctions in C and types
functions in C and types
 
enums
enumsenums
enums
 
Set methods in python
Set methods in pythonSet methods in python
Set methods in python
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Variables in python
Variables in pythonVariables in python
Variables in python
 
Python-03| Data types
Python-03| Data typesPython-03| Data types
Python-03| Data types
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
Exception handling in python
Exception handling in pythonException handling in python
Exception handling in python
 
Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 
Chomsky Normal Form
Chomsky Normal FormChomsky Normal Form
Chomsky Normal Form
 
Abstract class in c++
Abstract class in c++Abstract class in c++
Abstract class in c++
 
Python ppt
Python pptPython ppt
Python ppt
 
Unicode basics in python
Unicode basics in pythonUnicode basics in python
Unicode basics in python
 
Function in c language(defination and declaration)
Function in c language(defination and declaration)Function in c language(defination and declaration)
Function in c language(defination and declaration)
 
python.pptx
python.pptxpython.pptx
python.pptx
 
Tuple in python
Tuple in pythonTuple in python
Tuple in python
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 

Similar to Components of a python program

python_Yawar_Rasul.pptx
python_Yawar_Rasul.pptxpython_Yawar_Rasul.pptx
python_Yawar_Rasul.pptx
GetWebb
 

Similar to Components of a python program (20)

python_Yawar_Rasul.pptx
python_Yawar_Rasul.pptxpython_Yawar_Rasul.pptx
python_Yawar_Rasul.pptx
 
Python_UNIT-I.pptx
Python_UNIT-I.pptxPython_UNIT-I.pptx
Python_UNIT-I.pptx
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
C-PROGRAM
C-PROGRAMC-PROGRAM
C-PROGRAM
 
Computer programming in C. Library functions in C.
Computer programming in C. Library functions in C.Computer programming in C. Library functions in C.
Computer programming in C. Library functions in C.
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compiler
 
c_programming.pdf
c_programming.pdfc_programming.pdf
c_programming.pdf
 
11 Unit 1 Chapter 02 Python Fundamentals
11  Unit 1 Chapter 02 Python Fundamentals11  Unit 1 Chapter 02 Python Fundamentals
11 Unit 1 Chapter 02 Python Fundamentals
 
Python
PythonPython
Python
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Python unit 1 (1).pptx
Python unit 1 (1).pptxPython unit 1 (1).pptx
Python unit 1 (1).pptx
 
Unit 7. Functions
Unit 7. FunctionsUnit 7. Functions
Unit 7. Functions
 
INTRODUCTION TO C PROGRAMMING - PART 2
INTRODUCTION TO C PROGRAMMING - PART 2INTRODUCTION TO C PROGRAMMING - PART 2
INTRODUCTION TO C PROGRAMMING - PART 2
 
Functions
FunctionsFunctions
Functions
 
An Introduction on Functions in python 3.pdf
An Introduction on Functions in python 3.pdfAn Introduction on Functions in python 3.pdf
An Introduction on Functions in python 3.pdf
 
Analysis of the source program
Analysis of the source programAnalysis of the source program
Analysis of the source program
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problems
 
SENG 208 Week -5 Python Functions Presentation
SENG 208 Week -5 Python Functions PresentationSENG 208 Week -5 Python Functions Presentation
SENG 208 Week -5 Python Functions Presentation
 
Unit - 2 CAP.pptx
Unit - 2 CAP.pptxUnit - 2 CAP.pptx
Unit - 2 CAP.pptx
 

More from Learnbay Datascience

More from Learnbay Datascience (20)

Top data science projects
Top data science projectsTop data science projects
Top data science projects
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
 

Recently uploaded

plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
parmarsneha2
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 

Components of a python program

  • 2. Components of any Python Program are as below:- Components of Python Program Python Suite Comments Statement Blocks and Indentations Literals Constants Identifiers Variables reserved words Expression
  • 3. An expression is a combination of values, variables, operators and call-to-functions. Expressions need to be evaluated. If you use print function for an expression then it evaluates the expressions and prints the result. Expression generally evaluates to a value, which is why expression is written on the right hand side in an assignment statement. A single value itself is a simple expression. Expressions in Python
  • 4. Python expressions only contain identifiers, literals, and operators. some of those operators are:- Token Operator How to create an expression? add subtract multiply power Integer Division remainder decorator + - * ** / % @
  • 5. An escape sequence consists of a special character, such as backslash(), followed by a required character. Whitespace is represented by these characters. Whitespace gives characters like space, tab, formfeed, vertical tab. Escape sequence in python
  • 6. Few important escape sequences are mentioned as below:- Escape sequence Escape sequence n t v 1. 2. 3. 4. 5. 6. write a single line string into multi line string To print new line Horizontal tab Vertical tab Escape sequence in python
  • 7. Data Types in Python Mutable vs Immutable Data type in Python Stay Tuned with Topics for next Post