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 Blocks and Indentation

In Python, a block is a group of statements that belong together. Python uses indentation to define these blocks instead of braces such as { }.

What is a Block in Python?

A block is a group of statements executed together when a condition, loop, function or other control structure is used.

if age >= 18:
    print("You are eligible to vote.")
    print("You are an adult.")

The two print() statements are part of the if block because they have the same indentation.

What is Indentation?

Indentation means leaving spaces at the beginning of a line. Python uses indentation to identify the statements belonging to a block. Usually, 4 spaces are used for one level of indentation.

if marks >= 40:
    print("Pass")
    print("Congratulations")

Indentation with if-else

marks = 65

if marks >= 40:
    print("Pass")
else:
    print("Fail")
Output:
Pass

Nested Blocks

A block can contain another block. This is called a nested block.

marks = 85

if marks >= 40:
    if marks >= 80:
        print("Grade A")
    else:
        print("Grade B")
Output:
Grade A

Indentation with Loops

Statements inside a loop must be indented.

for i in range(1, 4):
    print(i)
Output:
1
2
3

Incorrect Indentation

Incorrect or inconsistent indentation can produce an IndentationError.

if age >= 18:
print("Eligible")

The print() statement must be indented because it belongs to the if block.

Important Rules of Indentation

  • Use indentation to define a block.
  • Use consistent indentation throughout the program.
  • Four spaces are commonly used for one indentation level.
  • Statements at the same indentation level belong to the same block.
  • Do not mix spaces and tabs unnecessarily.
Key Point: Python uses indentation as part of its syntax. Proper indentation is essential for defining blocks and writing error-free Python programs.