PRACTICAL LIST 2019-2020
CLASS 12TH CS
Python Revision Tour I and II
1. Create a dictionary containing name of competition winner students as a key and their
wins as values.
Working with Functions
2. Write a function that receives two numbers in a function and returns the results of all
arithmetic operations on these numbers.
3. Write a function to swap two values of two variables through a function.
4. Write a random number generator using functions that generates random numbers
between 1 and 6 (simulates a dice).
Python library
5. Open a webpage using the url lib library.
File handling
6. Write a menu driven program to perform following
a. Read a file line by line.
b. count the number of lines in your file and size of the file in bytes.
c. Count the number of words in your file.
d. Replace every space by #.
7. Write a python program to perform the following
a. Count the number of vowels and consonants in a file.
b. Count upper case and lower case word in file.
c. Count the word ‘to’ and ‘the’ in your file.
d. Count the line which start with alphabets ‘A’.
8. To get role number, name and mark of 5 students. Store the details on file marks.dat
Calculate the result of individual students.
9. Read content of file “sports.dat” .Create a new file athletics that copies only those
records where the event name is athletics.
Recursion
10. Recursively find the factorial of a natural number.
11. Write a recursive code to find the sum of all elements of a list.
12. Write a recursive code to compute the nth Fibonacci number.
13. Write a recursive Python program to test if a string is a palindrome or not.
Data visualization using pyplot
14. Create a graphical application that accepts user inputs, performs some operation on
them, and then writes the output on the screen. e.g. a small calculator. (use tkinter
library)
15. Write a Python program to plot the function y = x2 using the pyplot or matplotlib
libraries.
16. Compute EMIs for a loan using the numpy or scipy libraries.
Data Structures
17. Write a Python function sin(x, n) to calculate the value of sin(x) using its Taylor series
expansion up to n terms. Compare the values of sin(x) for different values of n with the
correct value.
18. Write a Python program to implement a stack using a list data-structure.
19. Write a Python program to implement a queue using a list data-structure.
My SQL
20. Create a table student with 10 dummy records and find the min, max, sum, and average
of the marks from this table.
21. Write a SQL query to order the (student ID, marks) table in descending order of the
marks.
22. Find the total number of customers from each country in the table (customer ID,
customer name, country) using group by.
23. Write a Django based web server to parse a user request (POST), and write it to a
CSV file.
24.Integrate SQL with Python by importing the MySQL module
25.Take a sample of 10 phishing e-mails and find the most common words.