You are on page 1of 3

Practical Questions Date

No.
1 Write a Python program for creating a menu driven program to perform arithmetic
operations.
2 Write a Python program for creating a menu driven program to find factorial and
sum of list of numbers using function.
3 Write a Python program to find the Fibonacci series up to nth term using function.
4 Write a Python program create a random number generator that generates random
numbers between 1 and 6 (simulates a dice).
5 Write a Python program to check whether a value exists in dictionary.
6 Write a Python program to find simple interest using a user defined function with
parameters and with return value.
7 Write a Python program to pass a list as function argument and modify it.
8 Write a menu-driven python program to implement stack operation.
9 Write a program to implement a stack for the employee details (empno, name).
10 Write a program to create a Stack for storing only odd numbers out of all the
numbers entered by the user.
Display the content of the Stack along with the largest odd number in the Stack.
(Hint. Keep popping out the elements from stack and maintain the largest element
retrieved so far in a variable. Repeat till Stack is empty)
11 Write a Python program to type text in a fill till – is pressed as rightmost character.
12 Write a Python program to show word with maximum length from a text file.
13 Write a Python program to copy the contents of open file to another.
14 Write a program in Python to read a text file line by line and display each word
separated by a #.
15 Write a program in Python to read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the file.
16 Write a program in Python to remove all the lines that contain the character 'a' in a
file and write it to another file.
17 Write a program in Python to create a binary file with roll number, name and marks.
Input a roll number and update the marks.
18 Write a program in Python to create a binary file with name and roll number. Search
for a given roll number and display the name, if not found display appropriate
message.
19 Write a program in Python to create a CSV file by entering user-id and password,
read and search the password for given userid.
20 Write Queries for the following Questions :
• Create an Employee Table with the fields Empno, Empname, Desig, Dept, Age
and Place.
• Enter five records into the table.
• Add two more records to the table.
• Modify the table structure by adding one more field namely doj.
• Check for Null value in doj of any record.
• List the employees who joined after 2018/01/01.
21. Write Queries for the following Questions based on the given table:

(a) Write a Query to select distinct Department from STU table.


(b) To show all information about students of History department.
(c) Write a Query to list name of female students in Hindi Department.
(d) Write a Query to list name of the students whose ages are between 18 to 20.
(e) Write a Query to display the name of the students whose name is starting with 'A'.
(f) Write a Query to list the names of those students whose names have second
alphabet ‘n’ in their names.
22. Write Queries for the following Questions based on the given table:

(a) Write a Query to delete the details of Roll number is 8.


(b) Write a Query to change the fees of Student to 170 whose Roll number is 1, if the
existing fees is less than 130.
(c) Write a Query to add a new column Area of type varchar in table STU.
(d) Write a Query to Display Name of all students whose Area Contains NULL.
(e) Write a Query to delete Area Column from the table STU.
(f) Write a Query to delete table from Database.
23 Write Queries for the following Questions based on the given table:

(a) To display the total Unit price of all the products whose Dcode as 102.
(b) To display details of all products in the stock table in descending order of Stock date
(c) To display maximum unit price of products for each dealer individually as per decode
from the table Stock.
(d) To display the Pname and Dname from table stock and dealers.
24. Write a MySQL connectivity program in Python to to insert records in EMP table
and display those records.
25. Write a Python program to interface Python with MySQL to search an Employee using
EMPID and display the record if present in already existing table EMP, if not display
appropriate message.

You might also like