Unit-Wise Python Programs
UNIT – 1
1. Write a Python program to check number is Prime or not
2. Write a Python program to check number is even or odd
3. Write a Python program to check number is an Armstrong number
4. Write a Python program to demonstrate all types of data types & its types by using type ()?
5. Write a Python program to perform swapping operations with and without using a temporary variable
6. Write a Python program to perform basic arithmetic operations on two numbers.
7. Write a Python program to perform string operations using all common string methods.
8. Write a Python program to demonstrate different types of print() statements with formatting.
9. Write a Python program to solve mathematical expressions for calculating delta = (√(b² − 4ac))
10. Write a Python program to identify the student's grade using if statement.
11. Write a Python program to print the multiplication table of a given number using for and while.
UNIT – 2
1. Write a program to find the largest and smallest elements in a list.
2. Write a program to demonstrate list methods: append(), insert(), remove(), pop() and sort().
3. Write a program to implement a stack and a queue using a list operation
4. Write a program to create a nested tuple and access its elements.
5. Write a program to perform all the tuple operations
6. Write a program to create a dictionary of student details (roll, name, marks) and display them.
7. Write a program to add, update, and delete elements in a dictionary.
8. Write a program to create a nested dictionary and access specific elements.
9. Write a program to create two sets and perform union, intersection, difference, and symmetric
difference.
10. Write a program to demonstrate the use of a frozen set.
Unit – 3
1. Write a Python program to perform the Factorial of a number
2. Write a Python program to perform the GCD of two numbers
3. Write a Python program to perform the Fibonacci series
4. Write a program showing the use of the global keyword.
5. Write a program to explain variable scope inside and outside a function.
6. Write a lambda function to find the square of a number.
7. Write a lambda function to find the multiplication table of any number.
8. Write a lambda function to find the maximum of two numbers.
9. Write a program to show that functions are objects.
10. Write a program combining map ( ), filter( ), and reduce( ).
Unit – 4
1. Write a program to create a text file, write and read the student details into it.
2. Write a program to append data to an existing file.
3. Write a program to count the number of lines, words, and characters in a file.
4. Write a program to merge the contents from one file to another file.
5. Write a program to display the current file position using tell() and change file position using seek().
6. Write a program to handle multiple exceptions using try-except
7. Write a program to raise a user-defined exception.
8. Create a custom exception class and use it in a program.
9. Write a Python program to validate the password using the exception raise()
Unit – 5
1. Write a Python program to create NumPy arrays using zeros(), ones(), and arrange() functions.
2. Write a Python program to perform arithmetic operations (addition, subtraction, multiplication, and
division) between two NumPy arrays.
3. Write a Python program to demonstrate array indexing and slicing in NumPy.
4. Write a Python program to create a Pandas Data Frame from a dictionary.
5. Write a Python program to read data from a CSV file using Pandas.
6. Write a Python program to handle missing values in a Data Frame using isnull(), dropna(), and fillna()
functions.
7. Write a Python program to group data using groupby() and perform aggregation functions such as sum()
and mean().
8. Write a Python program to implement single inheritance.
9. Write a Python program to demonstrate method overriding in inheritance.
10. Write a Python program to implement a Bank Account class with deposit() and withdraw() methods.