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 Keywords

Keywords are reserved words in Python that have a predefined meaning. They are part of the Python language syntax and cannot be used as variable, function or class names.

Python provides keywords for decision making, loops, functions, classes, exception handling, Boolean operations and other programming tasks.

List of Python Keywords

The following are the Python keywords used in modern Python 3:

Keyword Purpose
andLogical AND operation
asCreates an alias
assertChecks whether a condition is true
asyncDefines an asynchronous function
awaitWaits for an asynchronous operation
breakTerminates a loop
caseDefines a pattern in match statements
classDefines a class
continueSkips the current loop iteration
defDefines a function
delDeletes an object or item
elifTests another condition
elseExecutes when a condition is false
exceptHandles an exception
FalseBoolean false value
finallyExecutes after try/except
forCreates a for loop
fromImports selected objects from a module
globalRefers to a global variable
ifTests a condition
importImports a module
inTests membership or iterates over values
isTests object identity
lambdaCreates an anonymous function
matchStarts pattern matching
NoneRepresents no value
nonlocalRefers to a variable in an enclosing function
notLogical NOT operation
orLogical OR operation
passCreates an empty statement
raiseRaises an exception
returnReturns a value from a function
TrueBoolean true value
tryStarts exception handling
whileCreates a while loop
withManages resources using a context manager
yieldReturns a value from a generator

Python Keywords with Examples

1. and, or, not

These keywords are used for logical operations.

age = 20

print(age >= 18 and age <= 60)
print(age < 18 or age > 60)
print(not age < 18)

2. if, elif and else

These keywords are used for decision making.

marks = 75

if marks >= 80:
    print("Grade A")
elif marks >= 40:
    print("Pass")
else:
    print("Fail")
Output:
Pass

3. for, while, break and continue

These keywords are used to control loops.

for i in range(1, 6):
    if i == 3:
        continue
    if i == 5:
        break
    print(i)
Output:
1
2
4

4. def and return

def defines a function and return sends a value back to the calling statement.

def add(a, b):
    return a + b

print(add(10, 20))
Output:
30

5. class

The class keyword is used to create a class.

class Student:
    name = "Rahul"

s = Student()
print(s.name)
Output:
Rahul

6. import and from

These keywords are used to work with modules.

import math
print(math.sqrt(25))

The from keyword can be used to import a particular object.

from math import sqrt

print(sqrt(36))

7. in and is

in checks membership, while is checks whether two references point to the same object.

numbers = [10, 20, 30]

print(20 in numbers)

a = None
print(a is None)
Output:
True
True

8. True, False and None

True and False represent Boolean values. None represents the absence of a value.

x = True
y = False
z = None

print(x)
print(y)
print(z)

9. pass

The pass keyword is used when a statement is required syntactically but no action is needed.

def display():
    pass

10. try, except, else and finally

These keywords are used for exception handling.

try:
    x = 10 / 0
except ZeroDivisionError:
    print("Cannot divide by zero")
finally:
    print("Program completed")
Output:
Cannot divide by zero
Program completed

11. raise

The raise keyword is used to generate an exception manually.

age = 15

if age < 18:
    raise ValueError("Age must be 18 or above")

12. with and as

The with keyword is commonly used for file handling. The as keyword gives a name to the object being used.

with open("data.txt", "r") as file:
    data = file.read()
    print(data)

13. lambda

The lambda keyword creates a small anonymous function.

square = lambda x: x * x

print(square(5))
Output:
25

14. del

The del keyword removes an object, variable or item.

numbers = [10, 20, 30]

del numbers[1]

print(numbers)
Output:
[10, 30]

15. global

The global keyword allows a function to modify a global variable.

count = 0

def update():
    global count
    count = 10

update()
print(count)
Output:
10

16. nonlocal

The nonlocal keyword is used to modify a variable in an enclosing function.

def outer():
    x = 10

    def inner():
        nonlocal x
        x = 20

    inner()
    print(x)

outer()
Output:
20

17. assert

The assert keyword checks a condition and raises an AssertionError if the condition is false.

age = 20

assert age >= 18

print("Valid age")

18. yield

The yield keyword is used in a generator function to produce values one at a time.

def numbers():
    yield 1
    yield 2
    yield 3

for n in numbers():
    print(n)
Output:
1
2
3

19. async and await

async defines an asynchronous function and await is used to wait for an asynchronous operation.

import asyncio

async def message():
    print("Hello Python")

asyncio.run(message())

20. match and case

match and case are used for structural pattern matching.

day = 2

match day:
    case 1:
        print("Monday")
    case 2:
        print("Tuesday")
    case _:
        print("Other day")
Output:
Tuesday
Key Point: Python keywords have predefined meanings and should not be used as identifiers such as variable, function or class names. You can view the keywords supported by your installed Python version using keyword.kwlist.

View Python Keywords Using Python

import keyword

print(keyword.kwlist)