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 Variables

A variable is a name used to store a value in a Python program. Python variables are created when a value is assigned to a name. No separate declaration of the variable type is required.

Creating a Variable

The assignment operator = is used to assign a value to a variable.

name = "Rahul"
age = 20
marks = 85.5

print(name)
print(age)
print(marks)
Output:
Rahul
20
85.5

Dynamic Typing in Python

Python is a dynamically typed language. A variable does not need a fixed data type. Its type is determined automatically from the value assigned to it.

x = 10
print(x)

x = "Python"
print(x)
Output:
10
Python

Multiple Variable Assignment

Python allows multiple variables to be assigned values in a single statement.

a, b, c = 10, 20, 30

print(a)
print(b)
print(c)
Output:
10
20
30

Assigning the Same Value to Multiple Variables

x = y = z = 100

print(x)
print(y)
print(z)
Output:
100
100
100

Variable Naming Rules

Variables follow the same rules as Python identifiers.

  • A variable name can contain letters, digits and underscore.
  • It cannot start with a digit.
  • Spaces are not allowed in variable names.
  • Python keywords cannot be used as variable names.
  • Variable names are case-sensitive.
student_name = "Amit"
age2 = 21
_total = 500

Case-Sensitive Variables

Python treats uppercase and lowercase letters as different.

name = "Rahul"
Name = "Amit"

print(name)
print(Name)
Output:
Rahul
Amit

Variables and Data Types

A variable can store different types of values such as integers, floating-point numbers, strings, Boolean values and collections.

age = 20
price = 99.50
name = "Python"
passed = True

print(type(age))
print(type(price))
print(type(name))
print(type(passed))
Output:
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>

Changing the Value of a Variable

The value stored in a variable can be changed by assigning a new value.

score = 50
print(score)

score = 80
print(score)
Output:
50
80

Using Variables in Expressions

Variables can be used in mathematical expressions and calculations.

a = 10
b = 20

sum = a + b
product = a * b

print("Sum =", sum)
print("Product =", product)
Output:
Sum = 30
Product = 200

Deleting a Variable

The del keyword can be used to remove a variable.

x = 10
print(x)

del x

After del x, the variable x no longer exists.

Constants in Python

Python does not have a special keyword for declaring constants. By convention, names written in uppercase are used to indicate values that should not normally be changed.

PI = 3.14159
MAX_MARKS = 100

print(PI)
print(MAX_MARKS)

Local and Global Variables

A variable created inside a function is generally a local variable. A variable defined outside a function is generally a global variable.

x = 10

def display():
    y = 20
    print(x)
    print(y)

display()
Output:
10
20

Checking the Type of a Variable

The type() function is used to determine the data type of a variable.

value = 25

print(type(value))
Output:
<class 'int'>
Key Point: Python variables are created through assignment. Python automatically determines the type of the stored value, and the same variable can later refer to a value of a different type.