FREE E LEARNING PLATFORM
☰ HOMEEXCEPTIONSOOPSJVMINTRO
×

Python Syllabus

AKTU Python Syllabus AKTU Python Freshers AKTU Python Advanced AKTU Pyton PYQ AKTU Pyton PYQS 2026 AKTU Pyton PYQS 2025 AKTU Pyton PYQS 2024

Unit I Introduction

Introduction to Python History of Python Features of Python Applications of Python Python Installation Python IDE Python Program Life Cycle First Python Program Blocks & Indentation Comments Keywords Identifiers Variables Input & Output Data Types Numeric Data Types Type Conversion Python Operators

Unit II Control Statements

if Statement if...else Statement Nested if elif Statement for Loop range() Function while Loop Nested Loops break Statement continue Statement pass Statement else with Loop

Unit III Complex Data Types

Strings String Operations String Methods String Built-in Functions Lists List Slicing List Methods List Built-in Functions Tuples Tuple Methods Dictionaries Dictionary Methods Dictionary Built-in Functions Python Built-in Functions Python Functions User Defined Functions Lambda Functions Recursive Functions

Unit IV File Handling

Introduction to File Handling open() read() readline() readlines() write() writelines() File Pointer seek() tell() File Modes

Unit V Packages & GUI

Modules Packages NumPy Pandas Matplotlib Tkinter Introduction Tkinter Widgets Button Widget Label Widget Entry Widget Frame Widget Menu Widget Event Handling Programming with IDE Tkinter Mini Project

Python Programs

100+ Solved Programs Pattern Programs File Programs Tkinter Programs

AKTU Questions

Unit I Questions Unit II Questions Unit III Questions Unit IV Questions Unit V Questions Viva Questions Python MCQs

Previous Papers

AKTU 2026 (Solved) AKTU 2025 (Solved) AKTU 2024 (Solved) AKTU 2023 (Solved) AKTU 2022 (Solved)
 


Python Operators

Operators are special symbols or keywords used to perform operations on values and variables. Python provides different types of operators for arithmetic calculations, comparisons, logical operations, assignments and other programming tasks.

Types of Python Operators

Operator Type Purpose
Arithmetic Operators Perform mathematical calculations
Assignment Operators Assign and update values
Comparison Operators Compare two values
Logical Operators Combine or reverse conditions
Bitwise Operators Perform operations on individual bits
Membership Operators Check whether a value exists in a sequence
Identity Operators Check whether two references refer to the same object

1. Arithmetic Operators

Arithmetic operators are used to perform mathematical calculations.

Operator Name Example
+ Addition 10 + 3
- Subtraction 10 - 3
* Multiplication 10 * 3
/ Division 10 / 3
// Floor Division 10 // 3
% Modulus 10 % 3
** Exponentiation 10 ** 3

Addition

a = 10
b = 5

print(a + b)
Output:
15

Subtraction

a = 10
b = 5

print(a - b)
Output:
5

Multiplication

a = 10
b = 5

print(a * b)
Output:
50

Division

The / operator performs normal division and returns a floating-point result.

a = 10
b = 3

print(a / b)
Output:
3.3333333333333335

Floor Division

The // operator performs floor division. It returns the floor of the division result.

a = 10
b = 3

print(a // b)
Output:
3

Modulus

The % operator returns the remainder of a division.

a = 10
b = 3

print(a % b)
Output:
1

Exponentiation

The ** operator is used to calculate powers.

a = 2
b = 5

print(a ** b)
Output:
32

2. Assignment Operators

Assignment operators are used to assign values to variables. Python also provides compound assignment operators that perform an operation and assignment in a single statement.

Operator Example Equivalent Operation
= x = 10 x = 10
+= x += 5 x = x + 5
-= x -= 5 x = x - 5
*= x *= 5 x = x * 5
/= x /= 5 x = x / 5
//= x //= 5 x = x // 5
%= x %= 5 x = x % 5
**= x **= 2 x = x ** 2
x = 10

x += 5
print(x)

x *= 2
print(x)

x -= 4
print(x)
Output:
15
30
26

3. Comparison Operators

Comparison operators compare two values and return either True or False.

Operator Meaning
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
a = 10
b = 20

print(a == b)
print(a != b)
print(a < b)
print(a > b)
print(a <= b)
print(a >= b)
Output:
False
True
True
False
True
False

4. Logical Operators

Logical operators are used to combine conditional expressions.

Operator Description
and Returns true when both conditions are true.
or Returns true when at least one condition is true.
not Reverses the Boolean result.

and Operator

age = 25

print(age >= 18 and age <= 60)
Output:
True

or Operator

marks = 85

print(marks >= 90 or marks >= 80)
Output:
True

not Operator

x = True

print(not x)
Output:
False

5. Bitwise Operators

Bitwise operators perform operations on the binary representation of integer values.

Operator Name
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
~ Bitwise NOT
<< Left Shift
>> Right Shift

Bitwise AND

a = 5
b = 3

print(a & b)
Output:
1

Bitwise OR

a = 5
b = 3

print(a | b)
Output:
7

Bitwise XOR

a = 5
b = 3

print(a ^ b)
Output:
6

Bitwise NOT

a = 5

print(~a)
Output:
-6

Left Shift

a = 5

print(a << 1)
Output:
10

Right Shift

a = 10

print(a >> 1)
Output:
5

6. Membership Operators

Membership operators are used to check whether a value exists in a sequence such as a string, list, tuple, set or dictionary.

Operator Meaning
in Returns true if the value is present.
not in Returns true if the value is not present.
numbers = [10, 20, 30, 40]

print(20 in numbers)
print(50 in numbers)
print(50 not in numbers)
Output:
True
False
True

Membership Operator with String

text = "Python Programming"

print("Python" in text)
print("Java" in text)
Output:
True
False

7. Identity Operators

Identity operators are used to determine whether two variables refer to the same object in memory.

Operator Meaning
is Returns true if two references refer to the same object.
is not Returns true if two references do not refer to the same object.
a = [10, 20]
b = a
c = [10, 20]

print(a is b)
print(a is c)
print(a == c)
Output:
True
False
True

Here, a and b refer to the same list object, so a is b is True. The lists referenced by a and c contain the same values, so a == c is True, but they are different objects, so a is c is False.


8. Operator Precedence

When an expression contains more than one operator, Python follows a specific order called operator precedence.

For example, multiplication is performed before addition.

result = 10 + 5 * 2

print(result)
Output:
20

The multiplication 5 * 2 is performed first, followed by the addition.

Using Parentheses

Parentheses can be used to change the normal order of evaluation.

result = (10 + 5) * 2

print(result)
Output:
30

Basic Precedence Order

Priority Operators
1 ()
2 **
3 +x, -x, ~x
4 *, /, //, %
5 +, -
6 Comparison operators
7 not
8 and
9 or

9. Example Using Multiple Operators

a = 10
b = 5
c = 2

result = a + b * c

print(result)
Output:
20

First, b * c is evaluated, giving 10. Then a + 10 is evaluated, giving 20.


Important Points

  • Operators are used to perform operations on values and variables.
  • Arithmetic operators perform mathematical calculations.
  • Assignment operators assign and update values.
  • Comparison operators return True or False.
  • Logical operators combine Boolean conditions.
  • Bitwise operators work on the binary representation of integers.
  • Membership operators are in and not in.
  • Identity operators are is and is not.
  • Operator precedence determines the order in which an expression is evaluated.
  • Parentheses can be used to explicitly control the order of evaluation.
Key Point: Python provides arithmetic, assignment, comparison, logical, bitwise, membership and identity operators. Understanding these operators is essential for writing expressions and conditions in Python.