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 Data Types

A data type defines the kind of value stored in a Python variable. Python automatically determines the data type when a value is assigned to a variable. The type() function can be used to find the type of a value.

Types of Data Types in Python

Python provides several built-in data types. The commonly used types are:

Category Data Types Example
Numeric int, float, complex 10, 10.5, 2+3j
Boolean bool True, False
Text str "Python"
Sequence list, tuple, range [1,2,3], (1,2,3)
Set set, frozenset {1,2,3}
Mapping dict {"name":"Amit"}
Binary bytes, bytearray, memoryview b"Python"
None NoneType None

1. Numeric Data Types

Python provides three main numeric data types: int, float and complex.

Integer (int)

The int type represents whole numbers without a decimal part. Integers can be positive, negative or zero.

age = 20
temperature = -5
count = 0

print(type(age))
print(type(temperature))
Output:
<class 'int'>
<class 'int'>

Float (float)

The float type represents numbers containing a decimal point.

price = 99.50
percentage = 85.75

print(type(price))
print(type(percentage))
Output:
<class 'float'>
<class 'float'>

Complex (complex)

A complex number has a real part and an imaginary part. Python uses j to represent the imaginary part.

z = 2 + 3j

print(z)
print(type(z))
Output:
(2+3j)
<class 'complex'>

Numeric data types are covered in more detail in the next tutorial.

2. Boolean Data Type

The bool type represents one of two values: True or False. Boolean values are commonly used in conditions and decision-making statements.

is_student = True
is_logged_in = False

print(is_student)
print(type(is_student))
Output:
True
<class 'bool'>

Boolean values are also produced by comparison expressions.

age = 20

print(age >= 18)
print(age == 15)
Output:
True
False

3. String Data Type

The str type is used to store text. Strings can be written using single quotes, double quotes or triple quotes.

name = "Rahul"
city = 'Noida'

print(name)
print(city)
print(type(name))
Output:
Rahul
Noida
<class 'str'>

Strings are sequences of characters and support indexing and slicing.

text = "Python"

print(text[0])
print(text[0:3])
Output:
P
Pyt

4. List Data Type

A list is an ordered and mutable collection of items. A list can contain values of different data types.

numbers = [10, 20, 30, 40]

print(numbers)
print(numbers[0])

numbers.append(50)
print(numbers)
Output:
[10, 20, 30, 40]
10
[10, 20, 30, 40, 50]

5. Tuple Data Type

A tuple is an ordered collection of items. Unlike a list, a tuple is immutable, which means its elements cannot normally be changed after creation.

numbers = (10, 20, 30)

print(numbers)
print(numbers[1])
print(type(numbers))
Output:
(10, 20, 30)
20
<class 'tuple'>

6. Range Data Type

The range type represents a sequence of numbers and is commonly used with loops.

numbers = range(1, 5)

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

7. Set Data Type

A set is an unordered collection of unique elements. Duplicate values are automatically removed.

numbers = {10, 20, 20, 30}

print(numbers)
print(type(numbers))
Output:
{10, 20, 30}
<class 'set'>

8. Frozen Set

A frozenset is an immutable version of a set.

numbers = frozenset([10, 20, 30])

print(numbers)
print(type(numbers))

9. Dictionary Data Type

A dictionary stores data in key-value pairs. Each key is used to access its corresponding value.

student = {
    "name": "Rahul",
    "age": 20,
    "marks": 85
}

print(student["name"])
print(student["marks"])
Output:
Rahul
85

10. Bytes Data Type

The bytes type represents an immutable sequence of bytes. It is commonly used when working with binary data.

data = b"Python"

print(data)
print(type(data))
Output:
b'Python'
<class 'bytes'>

11. Bytearray Data Type

The bytearray type is similar to bytes but its contents can be modified.

data = bytearray([65, 66, 67])

data[0] = 68

print(data)
Output:
bytearray(b'DBC')

12. Memoryview Data Type

A memoryview object provides a view of the memory of a bytes-like object without making a copy of the data.

data = bytearray("Python", "utf-8")
view = memoryview(data)

print(view[0])
print(type(view))
Output:
80
<class 'memoryview'>

13. NoneType

The None value represents the absence of a value. Its data type is NoneType.

result = None

print(result)
print(type(result))
Output:
None
<class 'NoneType'>

Checking the Data Type

The type() function is used to determine the type of an object.

a = 10
b = 10.5
c = "Python"
d = [1, 2, 3]

print(type(a))
print(type(b))
print(type(c))
print(type(d))

Type Conversion

Python provides built-in functions such as int(), float() and str() to convert compatible values from one data type to another.

x = "100"

a = int(x)
b = float(x)
c = str(50)

print(a)
print(b)
print(c)
Output:
100
100.0
50

Mutable and Immutable Data Types

Python data types can also be classified as mutable and immutable.

Type Nature Examples
Mutable Can be modified after creation list, set, dict, bytearray
Immutable Cannot be modified after creation int, float, complex, bool, str, tuple, frozenset, bytes

Example of Mutable Data Type

numbers = [10, 20, 30]

numbers[0] = 100

print(numbers)
Output:
[100, 20, 30]

Example of Immutable Data Type

A string cannot be changed directly after it has been created.

name = "Python"

# A new string is created
name = "Java"

print(name)
Output:
Java
Key Point: Python has built-in data types for numbers, text, collections, Boolean values, binary data and the absence of a value. The type() function can be used to identify the type of a value.