Sample Practicle 2
Sample Practicle 2
S.
NAME OF PRACTICAL
No.
1 Write a program in python to check a number whether it is prime or not.
2 Write a program to check a number whether it is palindrome or not.
3 Write a program to display ASCII code of a character and vice versa.
Write a function SwapNumbers( ) to swap two numbers and display the numbers before
4
swapping and after swapping.
5 Write a program to find the sum of all elements of a list using recursion.
6 Write a program to calculate the factorial of an integer using recursion.
7 Write a program to print fibonacci series using recursion.
8 Write a recursive pyhton program to test if a string is palindrome or not.
Write a program to generate random numbers between 1 to 6 and check whether a user won a
9
lottery or not.
10 Write a program to count the number of vowels present in a text file.
Write a program to write those lines which have the character 'p' from one text file to another
11
text file.
12 Write a program to count number of words in a file.
13 Write a python program to write student data in a binary file.
14 Write a python program to read student data from a binary file.
15 Write a python program to modify/update student data in a binary file.
16 Write a python program to delete student data from a binary file.
17 Write a python program to search a student record in a binary file.
18 Write a program to perform read and write operation with .csv file.
19 Write a program to create a library in python and import it in a program.
20 Write a program for linear search.
21 Write a program for bubble sort.
22 Write a menu based program to perform the operation on stack in python.
23 Write a menu based program to perform the operation on queue in python.
SQL Queries :
Queries using Create database, Show databases, USE, Create table, Show Tables, Describe,
24
Rename, Alter, Select, From, Where, Insert, Update commands
Queries using DISTINCT, BETWEEN, IN, LIKE, IS NULL, ORDER BY, GROUP BY,
25
HAVING
26 Queries for Aggregate functions- SUM( ), AVG( ), MIN( ), MAX( ), COUNT( )
Write a program to connect Python with MySQL using database connectivity and perform the
27
following operations on data in database: Fetch, Update and delete the data