SlideShare a Scribd company logo
2
OPERATORS:
The operator can be defined as a symbol which is responsible for a particular
operation between two operands. Operators are used to perform operations
on variables and values.
The operator can be defined as a symbol which is responsible for a particular
operation between two operands. Operators are used to perform operations
on variables and values.
Arithmetic operators
Comparison operators
Assignment Operators
Logical Operators
Membership Operators
Identity Operators
Types of Operators
Most read
3
Arithmetic Operators
Arithmetic operators are used with numeric values to perform common
mathematical operations:
Operator Name Example
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
// Floor division[Integer Division] x // y
** Exponentiation x ** y
% Modulus x % y
Most read
8
Arithmetic Operators
Example 1:
A=27
B=5
C=A%B
print(“A%B=“,C)
--Output---
A%B=2
Example 2:
A=int(input(“Enter the value of A:”))
--Output---
Enter the value of A: 4
Enter the value of B: 2
A%B=0
% [Modulus] x % y : It return remainder value
C=A%B
print(“A%B=“,C)
B=int(input(“Enter the value of B:”))
Most read
PYTHON
CLASS: XI
COMPUTER SCIENCE(083)
OPERATORS IN PYTHON
PART-1
OPERATORS:
The operator can be defined as a symbol which is responsible for a particular
operation between two operands. Operators are used to perform operations
on variables and values.
The operator can be defined as a symbol which is responsible for a particular
operation between two operands. Operators are used to perform operations
on variables and values.
Arithmetic operators
Comparison operators
Assignment Operators
Logical Operators
Membership Operators
Identity Operators
Types of Operators
Arithmetic Operators
Arithmetic operators are used with numeric values to perform common
mathematical operations:
Operator Name Example
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
// Floor division[Integer Division] x // y
** Exponentiation x ** y
% Modulus x % y
Arithmetic Operators
+ Addition x + y
Example 1:
A=10
B=20
C=A+B
print(“A+B=“,C)
--Output---
A+B=30
Example 2:
A=10
B=20
--Output---
A+B=30
print(“A+B=“,A+B)
Example 3:
A=int(input(“Enter value A:”))
print(“A+B=“,C)
B=int(input(“Enter value B:”))
C=A+B
--Output---
Enter value A: 5
Enter value B: 4
A+B=9
Arithmetic Operators
Example 1:
A=20
B=10
C=A-B
print(“A-B=“,C)
--Output---
A-B=10
Example 2:
A=30
B=20
--Output---
A-B=10
print(“A-B=“,A-B)
Example 3:
A=int(input(“Enter value A:”))
print(“A-B=“,C)
B=int(input(“Enter value B:”))
C=A-B
--Output---
Enter value A: 5
Enter value B: 4
A-B=1
- Subtraction x - y
Arithmetic Operators
Example 1:
A=2
B=10
C=A*B
print(“A*B=“,C)
--Output---
A*B=20
Example 2:
A=3
B=2
--Output---
A*B=6
print(“A*B=“,A*B)
Example 3:
A=int(input(“Enter value A:”))
print(“A*B=“,C)
B=int(input(“Enter value B:”))
C=A*B
--Output---
Enter value A: 5
Enter value B: 4
A*B=20
* Multiplication x * y
Arithmetic Operators
Example 1:
A=27
B=5
C=A/B
print(“A/B=“,C)
--Output---
A/B=5.4
Example 2:
A=27
B=5
--Output---
A//B=5
/ [Division] x / y // Floor division[Integer Division] x // y
C=A//B
print(“A//B=“,C)
Arithmetic Operators
Example 1:
A=27
B=5
C=A%B
print(“A%B=“,C)
--Output---
A%B=2
Example 2:
A=int(input(“Enter the value of A:”))
--Output---
Enter the value of A: 4
Enter the value of B: 2
A%B=0
% [Modulus] x % y : It return remainder value
C=A%B
print(“A%B=“,C)
B=int(input(“Enter the value of B:”))
Arithmetic Operators
Example 1:
A=2
B=3
C=A**B
print(“A**B=“,C)
--Output---
A**B=8
Example 2:
A=int(input(Enter the value of A”))
B=int(input(“Enter the power”))
--Output---
Enter the value of A: 7
Enter the power: 2
A**B=49
C=A**B
print(“A**B=“,C)
** Exponentiation x ** y
Meaning of A**B
AB
Precedence of Arithmetic Operators
Highest
Lowest
() parentheses
** (Exponentiation)
/(division) // (integer division) * ( multiply)
% (modulas)
+ (addition) - ( subtraction)
Expressions:
An expression is a combination of variable and operators. It generates a
single value, which by itself is an expression.
Example:
5 + 2 * 4 and the result is 13
Q. Convert the Mathematical Expressions to equivalent python expressions
Algebraic Expression Python Programming Expression
5A 5 * A
4ab 4 * a * b
A2 + B2 A**2 + B **2
a=(x+y)/(x-y)
20 + 30 * 40
Evaluate the expressions:
1
2
20 + 120
140
20 - 30 + 40
1
2
-10 + 40
30
The two operators (–) and (+)
have equal precedence. Thus,
the first operator, i.e.,
subtraction is applied before
the second operator, i.e.,
addition (left to right).
Evaluate the expressions:
12 + 3 * 4 – 6/2
1
3
4
12 + 12 – 6/2
12 + 12 – 3.0
2
24– 3.0
21.0
(12 + 3) * 4 – 6//2
1
2
4
3 15 * 4 – 6//2
60 – 6//2
60 – 3
57
+ ( plus) and (*) sign for string
+ ( plus) : It is use to concatenation of string and in string case + (plus)
sign is known as concatenation operator.
Example:
If there are two variable A=‘WELCOME’ and B=‘PYTHON’ and we want
to join these two strings.
A=‘WELCOME’
B=‘PYTHON’
print(A+B)
---Output----
WELCOMEPYTHON
It display join or concatenation of
two string but without any gap
+ ( plus) and (*) sign for string
* (multiply) : It is use to repeat the string as many times we need by
multiplying the string with number given.
Example:
If variable A=‘WELCOME’ and we want to display WELCOME 3 times
A=‘WELCOME’
print(A*3)
---Output----
WELCOMEWELCOMEWELCOME

More Related Content

What's hot (20)

Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
imtiazalijoono
 
Arrays
ArraysArrays
Arrays
fahadshakeel
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
vikram mahendra
 
Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)
Dharma Kshetri
 
Python : Operators
Python : OperatorsPython : Operators
Python : Operators
Emertxe Information Technologies Pvt Ltd
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
Raajendra M
 
Arrays
ArraysArrays
Arrays
Saranya saran
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
Amit Kapoor
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
BAINIDA
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
Venkateswarlu Vuggam
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
Venkateswarlu Vuggam
 
Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'
Philip Schwarz
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
Saranya saran
 
CSE240 Pointers
CSE240 PointersCSE240 Pointers
CSE240 Pointers
Garrett Gutierrez
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribd
Amit Kapoor
 
18 dec pointers and scope resolution operator
18 dec pointers and scope resolution operator18 dec pointers and scope resolution operator
18 dec pointers and scope resolution operator
SAFFI Ud Din Ahmad
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
sanya6900
 
Operators in python
Operators in pythonOperators in python
Operators in python
Prabhakaran V M
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
Venkateswarlu Vuggam
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
Venkateswarlu Vuggam
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
imtiazalijoono
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
vikram mahendra
 
Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)
Dharma Kshetri
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
Raajendra M
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
Amit Kapoor
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
BAINIDA
 
Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'
Philip Schwarz
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
Saranya saran
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribd
Amit Kapoor
 
18 dec pointers and scope resolution operator
18 dec pointers and scope resolution operator18 dec pointers and scope resolution operator
18 dec pointers and scope resolution operator
SAFFI Ud Din Ahmad
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
sanya6900
 

Similar to OPERATOR IN PYTHON-PART1 (20)

Python Operators.pptx
Python Operators.pptxPython Operators.pptx
Python Operators.pptx
adityakumawat625
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
 
Lecture 05.pptx
Lecture 05.pptxLecture 05.pptx
Lecture 05.pptx
Mohammad Hassan
 
PYTHON OPERATORS 123Python Operators.pptx
PYTHON OPERATORS 123Python Operators.pptxPYTHON OPERATORS 123Python Operators.pptx
PYTHON OPERATORS 123Python Operators.pptx
AnjaneyuluKunchala1
 
Python Operators
Python OperatorsPython Operators
Python Operators
Adheetha O. V
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
python2oxhvoudhuSGFsughusgdogusuosFU.pdf
python2oxhvoudhuSGFsughusgdogusuosFU.pdfpython2oxhvoudhuSGFsughusgdogusuosFU.pdf
python2oxhvoudhuSGFsughusgdogusuosFU.pdf
rohithzach
 
Python (high level programming ) language
Python (high level programming ) languagePython (high level programming ) language
Python (high level programming ) language
worldeader
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
Alpha337901
 
Operators in python
Operators in pythonOperators in python
Operators in python
eShikshak
 
Session 4.pptx
Session 4.pptxSession 4.pptx
Session 4.pptx
YogeshwariK10
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
Anusuya123
 
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICALOPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
NagarathnaRajur2
 
Python operators
Python operatorsPython operators
Python operators
nuripatidar
 
Variables in Python & Data Types and Their Values
Variables in Python & Data Types and Their ValuesVariables in Python & Data Types and Their Values
Variables in Python & Data Types and Their Values
Raza Ul Mustafa
 
operatorsinpython-18112209560412 (1).pptx
operatorsinpython-18112209560412 (1).pptxoperatorsinpython-18112209560412 (1).pptx
operatorsinpython-18112209560412 (1).pptx
urvashipundir04
 
Python-Operators-and-Type-Conversion.pptx
Python-Operators-and-Type-Conversion.pptxPython-Operators-and-Type-Conversion.pptx
Python-Operators-and-Type-Conversion.pptx
teamfnatic28
 
Operators in python
Operators in pythonOperators in python
Operators in python
deepalishinkar1
 
Python Operators.pdf
Python Operators.pdfPython Operators.pdf
Python Operators.pdf
SudhanshiBakre1
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
S.M. Salaquzzaman
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
 
PYTHON OPERATORS 123Python Operators.pptx
PYTHON OPERATORS 123Python Operators.pptxPYTHON OPERATORS 123Python Operators.pptx
PYTHON OPERATORS 123Python Operators.pptx
AnjaneyuluKunchala1
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
python2oxhvoudhuSGFsughusgdogusuosFU.pdf
python2oxhvoudhuSGFsughusgdogusuosFU.pdfpython2oxhvoudhuSGFsughusgdogusuosFU.pdf
python2oxhvoudhuSGFsughusgdogusuosFU.pdf
rohithzach
 
Python (high level programming ) language
Python (high level programming ) languagePython (high level programming ) language
Python (high level programming ) language
worldeader
 
Operators in python
Operators in pythonOperators in python
Operators in python
eShikshak
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
Anusuya123
 
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICALOPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
NagarathnaRajur2
 
Python operators
Python operatorsPython operators
Python operators
nuripatidar
 
Variables in Python & Data Types and Their Values
Variables in Python & Data Types and Their ValuesVariables in Python & Data Types and Their Values
Variables in Python & Data Types and Their Values
Raza Ul Mustafa
 
operatorsinpython-18112209560412 (1).pptx
operatorsinpython-18112209560412 (1).pptxoperatorsinpython-18112209560412 (1).pptx
operatorsinpython-18112209560412 (1).pptx
urvashipundir04
 
Python-Operators-and-Type-Conversion.pptx
Python-Operators-and-Type-Conversion.pptxPython-Operators-and-Type-Conversion.pptx
Python-Operators-and-Type-Conversion.pptx
teamfnatic28
 
Ad

More from vikram mahendra (20)

Communication skill
Communication skillCommunication skill
Communication skill
vikram mahendra
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop system
vikram mahendra
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
vikram mahendra
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
vikram mahendra
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
vikram mahendra
 
FLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONFLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHON
vikram mahendra
 
FLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONFLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHON
vikram mahendra
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
vikram mahendra
 
GREEN SKILL[PART-2]
GREEN SKILL[PART-2]GREEN SKILL[PART-2]
GREEN SKILL[PART-2]
vikram mahendra
 
GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]
vikram mahendra
 
Dictionary in python
Dictionary in pythonDictionary in python
Dictionary in python
vikram mahendra
 
Entrepreneurial skills
Entrepreneurial skillsEntrepreneurial skills
Entrepreneurial skills
vikram mahendra
 
Boolean logic
Boolean logicBoolean logic
Boolean logic
vikram mahendra
 
Tuple in python
Tuple in pythonTuple in python
Tuple in python
vikram mahendra
 
LIST IN PYTHON[SELECTION SORT]
LIST IN PYTHON[SELECTION SORT]LIST IN PYTHON[SELECTION SORT]
LIST IN PYTHON[SELECTION SORT]
vikram mahendra
 
DATA REPRESENTATION-NUMBER SYSTEM-PART-5
DATA REPRESENTATION-NUMBER SYSTEM-PART-5DATA REPRESENTATION-NUMBER SYSTEM-PART-5
DATA REPRESENTATION-NUMBER SYSTEM-PART-5
vikram mahendra
 
DATA REPRESENTATION-NUMBER SYSTEM
DATA REPRESENTATION-NUMBER SYSTEMDATA REPRESENTATION-NUMBER SYSTEM
DATA REPRESENTATION-NUMBER SYSTEM
vikram mahendra
 
LIST IN PYTHON[BUBBLE SORT]
LIST IN PYTHON[BUBBLE SORT]LIST IN PYTHON[BUBBLE SORT]
LIST IN PYTHON[BUBBLE SORT]
vikram mahendra
 
Internet,its applications and services
Internet,its applications and servicesInternet,its applications and services
Internet,its applications and services
vikram mahendra
 
DATA REPRESENTATION [NUMBER SYSTEM]
DATA REPRESENTATION [NUMBER SYSTEM]DATA REPRESENTATION [NUMBER SYSTEM]
DATA REPRESENTATION [NUMBER SYSTEM]
vikram mahendra
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop system
vikram mahendra
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
vikram mahendra
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
vikram mahendra
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
vikram mahendra
 
FLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONFLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHON
vikram mahendra
 
FLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONFLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHON
vikram mahendra
 
LIST IN PYTHON[SELECTION SORT]
LIST IN PYTHON[SELECTION SORT]LIST IN PYTHON[SELECTION SORT]
LIST IN PYTHON[SELECTION SORT]
vikram mahendra
 
DATA REPRESENTATION-NUMBER SYSTEM-PART-5
DATA REPRESENTATION-NUMBER SYSTEM-PART-5DATA REPRESENTATION-NUMBER SYSTEM-PART-5
DATA REPRESENTATION-NUMBER SYSTEM-PART-5
vikram mahendra
 
DATA REPRESENTATION-NUMBER SYSTEM
DATA REPRESENTATION-NUMBER SYSTEMDATA REPRESENTATION-NUMBER SYSTEM
DATA REPRESENTATION-NUMBER SYSTEM
vikram mahendra
 
LIST IN PYTHON[BUBBLE SORT]
LIST IN PYTHON[BUBBLE SORT]LIST IN PYTHON[BUBBLE SORT]
LIST IN PYTHON[BUBBLE SORT]
vikram mahendra
 
Internet,its applications and services
Internet,its applications and servicesInternet,its applications and services
Internet,its applications and services
vikram mahendra
 
DATA REPRESENTATION [NUMBER SYSTEM]
DATA REPRESENTATION [NUMBER SYSTEM]DATA REPRESENTATION [NUMBER SYSTEM]
DATA REPRESENTATION [NUMBER SYSTEM]
vikram mahendra
 
Ad

Recently uploaded (20)

How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATIONTHE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
PROF. PAUL ALLIEU KAMARA
 
Dashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo SlidesDashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo Slides
Celine George
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdfপ্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
Pragya - UEM Kolkata Quiz Club
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT PatnaSwachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Quiz Club, Indian Institute of Technology, Patna
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General QuizPragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya - UEM Kolkata Quiz Club
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATIONTHE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
PROF. PAUL ALLIEU KAMARA
 
Dashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo SlidesDashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo Slides
Celine George
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdfপ্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
Pragya - UEM Kolkata Quiz Club
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
 

OPERATOR IN PYTHON-PART1

  • 2. OPERATORS: The operator can be defined as a symbol which is responsible for a particular operation between two operands. Operators are used to perform operations on variables and values. The operator can be defined as a symbol which is responsible for a particular operation between two operands. Operators are used to perform operations on variables and values. Arithmetic operators Comparison operators Assignment Operators Logical Operators Membership Operators Identity Operators Types of Operators
  • 3. Arithmetic Operators Arithmetic operators are used with numeric values to perform common mathematical operations: Operator Name Example + Addition x + y - Subtraction x - y * Multiplication x * y / Division x / y // Floor division[Integer Division] x // y ** Exponentiation x ** y % Modulus x % y
  • 4. Arithmetic Operators + Addition x + y Example 1: A=10 B=20 C=A+B print(“A+B=“,C) --Output--- A+B=30 Example 2: A=10 B=20 --Output--- A+B=30 print(“A+B=“,A+B) Example 3: A=int(input(“Enter value A:”)) print(“A+B=“,C) B=int(input(“Enter value B:”)) C=A+B --Output--- Enter value A: 5 Enter value B: 4 A+B=9
  • 5. Arithmetic Operators Example 1: A=20 B=10 C=A-B print(“A-B=“,C) --Output--- A-B=10 Example 2: A=30 B=20 --Output--- A-B=10 print(“A-B=“,A-B) Example 3: A=int(input(“Enter value A:”)) print(“A-B=“,C) B=int(input(“Enter value B:”)) C=A-B --Output--- Enter value A: 5 Enter value B: 4 A-B=1 - Subtraction x - y
  • 6. Arithmetic Operators Example 1: A=2 B=10 C=A*B print(“A*B=“,C) --Output--- A*B=20 Example 2: A=3 B=2 --Output--- A*B=6 print(“A*B=“,A*B) Example 3: A=int(input(“Enter value A:”)) print(“A*B=“,C) B=int(input(“Enter value B:”)) C=A*B --Output--- Enter value A: 5 Enter value B: 4 A*B=20 * Multiplication x * y
  • 7. Arithmetic Operators Example 1: A=27 B=5 C=A/B print(“A/B=“,C) --Output--- A/B=5.4 Example 2: A=27 B=5 --Output--- A//B=5 / [Division] x / y // Floor division[Integer Division] x // y C=A//B print(“A//B=“,C)
  • 8. Arithmetic Operators Example 1: A=27 B=5 C=A%B print(“A%B=“,C) --Output--- A%B=2 Example 2: A=int(input(“Enter the value of A:”)) --Output--- Enter the value of A: 4 Enter the value of B: 2 A%B=0 % [Modulus] x % y : It return remainder value C=A%B print(“A%B=“,C) B=int(input(“Enter the value of B:”))
  • 9. Arithmetic Operators Example 1: A=2 B=3 C=A**B print(“A**B=“,C) --Output--- A**B=8 Example 2: A=int(input(Enter the value of A”)) B=int(input(“Enter the power”)) --Output--- Enter the value of A: 7 Enter the power: 2 A**B=49 C=A**B print(“A**B=“,C) ** Exponentiation x ** y Meaning of A**B AB
  • 10. Precedence of Arithmetic Operators Highest Lowest () parentheses ** (Exponentiation) /(division) // (integer division) * ( multiply) % (modulas) + (addition) - ( subtraction)
  • 11. Expressions: An expression is a combination of variable and operators. It generates a single value, which by itself is an expression. Example: 5 + 2 * 4 and the result is 13 Q. Convert the Mathematical Expressions to equivalent python expressions Algebraic Expression Python Programming Expression 5A 5 * A 4ab 4 * a * b A2 + B2 A**2 + B **2 a=(x+y)/(x-y)
  • 12. 20 + 30 * 40 Evaluate the expressions: 1 2 20 + 120 140 20 - 30 + 40 1 2 -10 + 40 30 The two operators (–) and (+) have equal precedence. Thus, the first operator, i.e., subtraction is applied before the second operator, i.e., addition (left to right).
  • 13. Evaluate the expressions: 12 + 3 * 4 – 6/2 1 3 4 12 + 12 – 6/2 12 + 12 – 3.0 2 24– 3.0 21.0 (12 + 3) * 4 – 6//2 1 2 4 3 15 * 4 – 6//2 60 – 6//2 60 – 3 57
  • 14. + ( plus) and (*) sign for string + ( plus) : It is use to concatenation of string and in string case + (plus) sign is known as concatenation operator. Example: If there are two variable A=‘WELCOME’ and B=‘PYTHON’ and we want to join these two strings. A=‘WELCOME’ B=‘PYTHON’ print(A+B) ---Output---- WELCOMEPYTHON It display join or concatenation of two string but without any gap
  • 15. + ( plus) and (*) sign for string * (multiply) : It is use to repeat the string as many times we need by multiplying the string with number given. Example: If variable A=‘WELCOME’ and we want to display WELCOME 3 times A=‘WELCOME’ print(A*3) ---Output---- WELCOMEWELCOMEWELCOME