Programming in Python: (Programs for Practical File)
Note: The entire program implemented/run in Python or SQL before writing in to
Practical file.
1. Write a program that repeatedly asks from users some numbers until string ‘done’ is type. The
program should print the sum of all numbers entered.(pg-32)
2. Write a program that reads a string and check whether it is a palindrome string or not. (pg-75)
3. Program to search for an element in a given list of numbers.(cl-11 pg-248)
4. Write a function secondLargest(T) which takes as input a tuple T and returns the second largest
element in the tuple. You can use any of the standard Python functions to obtain your result.(cl-
11 pg-276)
5. Write a function that receives an octal number and prints the equivalent number in other
number bases i.e. in decimal, binary and hexadecimal equivalents.(pg-135)
6. Write a program that checks for presence of a value inside a dictionary and prints its key.(pg-69)
7. Write a program to sort a sequence using insertion sort.(pg-71)
8. Recursively find the factorial of a natural number.
9. Read a file line by line and print it.
10. Remove all the lines that contain the character `a’ in a file and write it to another file.
11. 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.
12. Write a random number generator that generates random numbers between 1 and 6 (simulates
a dice).
13. Write a recursive code to find the sum of all elements of a list.
14. Write a recursive code to compute the nth Fibonacci number.
15. Write a Python program to implement a stack and queue using a list data-structure.
16. Write a recursive Python program to test if a string is a palindrome or not.
17. Write a Python program to plot the function y = x2 using the pyplot or matplotlib libraries.
18. Create a graphical application that accepts user inputs, performs some operation on them, and
then writes the output on the screen. For example, write a small calculator. Use the tkinter
library.
19. Open a webpage using the urllib library.
20. Compute EMIs for a loan using the numpy or scipy libraries.
21. Take a sample of 10 phishing e-mails and find the most common words.
Data Management: SQL and web-server (SQL command for Practical File)
1. Find the min, max, sum, and average of the marks in a student marks table.
2. Find the total number of customers from each country in the table (customer ID, customer
name, country) using group by.
3. Write a SQL query to order the (student ID, marks) table in descending order of the marks.
4. Integrate SQL with Python by importing the MySQL module
5. Write a Django based web server to parse a user request (POST), and write it to a CSV file.