Python Basic Tutorial: Create PDF in Your Applications With The Pdfcrowd
Python Basic Tutorial: Create PDF in Your Applications With The Pdfcrowd
Python - Home
Python - Overview
Python - Loops
Python - Numbers
Python - Strings
Python - Lists
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Python - Tuples
Python - Dictionary
Python - Functions
Python - Modules
Python - Exceptions
Python - Classes/Objects
Python - Networking
Python - Multithreading
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Python - XML Processing
Python - Tools/Utilities
Python - Discussion
Operators are the constructs which can manipulate the value of operands.
Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called
operator.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Types of Operator
Python language supports the following types of operators.
Arithmetic Operators
Assignment Operators
Logical Operators
Bitwise Operators
Membership Operators
Identity Operators
[ Show Example ]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
operand
[ Show Example ]
<> If values of two operands are not equal, (a <> b) is true. This is similar to !=
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
then condition becomes true. operator.
[ Show Example ]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
AND operand
a = 0011 1100
b = 0000 1101
-----------------
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
a^b = 0011 0001
~a = 1100 0011
[ Show Example ]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
[ Show Example ]
and
If both the operands are true then
Logical (a and b) is true.
condition becomes true.
AND
not
Used to reverse the logical state of its
Logical Not(a and b) is false.
operand.
NOT
[ Show Example ]
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Python Identity Operators
Identity operators compare the memory locations of two objects. There are two Identity
operators explained below −
[ Show Example ]
[ Show Example ]
**
1
Exponentiation (raise to the power)
2 ~+-
Complement, unary plus and minus (method names for the last two are +@ and
-@)
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
* / % //
3
Multiply, divide, modulo and floor division
+-
4
Addition and subtraction
>> <<
5
Right and left bitwise shift
&
6
Bitwise 'AND'
^|
7
Bitwise exclusive `OR' and regular `OR'
<> == !=
9
Equality operators
= %= /= //= -= += *= **=
10
Assignment operators
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
11 is is not
Identity operators
in not in
12
Membership operators
not or and
13
Logical operators
Advertisements
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD