Xii Practical List (1-15)
Xii Practical List (1-15)
1. Write a python program to pass list to a function and double the odd values and half even
values of a list and display list element after changing.
2. Write a Python program input n numbers in tuple and pass it to function to count how many
even and odd numbers are entered.
3. Write a Python program to function with key and value, and update value at that key in
dictionary entered by user.
4. Write a program to pass a string to a function and count how many vowels and consonants
present in the string
8. Write a python program to read and display file content line by line with each word separated
by #.
9. Write a python program to remove all the lines that contain the character ‘a’ in a file and write
it to another file.
10. Write a python program to read characters from keyboard one by one, all lower case letters
gets stored inside a file “LOWER”, all uppercase letters gets stored inside a file “UPPER”, and
all other characters get stored inside “OTHERS”
11. Write a python program to create a binary file with name and roll number. Search for a given
roll number and display name, if not found display appropriate message.
12. Write a python program to create a binary file with roll number, name and marks, input a roll
number and update the marks.
13. Write a python program to create a CSV file with empid, name and mobile no. and search
empid, update the record and display the records.
14. Write a Python program to create Lpush( ) and Lpop( ) function to do push and pop operation
on a stack using a list e.g. take a student information and push and pop the details.
15. Create a student table and insert data. Implement the following SQL commands on the student
table:
ALTER table to add new attributes / modify data type / drop attribute
UPDATE table to modify data ORDER By to display data in ascending / descending order
DELETE to remove tuple(s) GROUP BY and find the min, max, sum, count and average
16. Integrate SQL with Python by importing the MySQL module record of employee and display
the record.
17. Integrate SQL with Python by importing the MySQL module to search an employee using
empno and if present in table display the record, if not display appropriate method.
18. Integrate SQL with Python by importing the MySQL module to search a student using rollno,
update the record.
19. Integrate SQL with Python by importing the MySQL module to search a student using rollno,
delete the record.
21.Write a python program to simulate graphic calculator using tkinter library in python.
PRACTICAL- 1
AIM- Write a program to pass list to a function and double the odd
values and half even values of a list and display list element
after changing
INPUT
OUTPUT
PRACTICAL- 2
AIM- Write a program to function with key and value, and update value at that
key in dictionary entered by user SOFTWARE USED- IDLE (PYTHON 3.8 64-BIT)
INPUT
PRACTICAL- 4
AIM
OUTPUT
PRACTICAL- 5
AIM
OUTPUT(S)
PRACTICAL- 6
AIM
OUTPUT
PRACTICAL- 8
AIM- Write a program to read and display file content line by line
with each word separated by #.
OUTPUT
PRACTICAL- 9
AIM- Write a program to remove all the lines that contain the
character ‘a’ in a file and write it to another file.
OUTPUT
PRACTICAL- 10
OUTPUT
PRACTICAL- 11
AIM- Write a program to create a binary file with name and roll number.
search for a given roll number and display name, if not found display
appropriate message SOFTWARE USED- IDLE (PYTHON 3.8 64-BIT)
INPUT
OUTPUT
PRACTICAL- 12
AIM- Write a program to create a binary file with roll number, name
and marks, input a roll number and update the marks.
OUTPUT
PRACTICAL- 13
AIM- Write a program to create a CSV file with empid, name and
mobile no. and search empid, update the record and display the
records
INPUT
OUTPUT
PRACTICAL- 14
DELETE to remove tuple(s) GROUP BY and find the min, max, sum, count and
desc student;
* from student;
ADDING COLUMN IN TABLE USING ALTER COMMAND
desc student;
* from student;
student;
desc student;
column Adhaar_card;
desc student;
order by Percentage;
AVERAGE COMMAND select
from student;
* from student;