Practical
Practical
AIM- Write
a program to search an element in a list and display the
frequency of element present in list and their location using Linear search
OUTPUT
2. AIM- Write a to
search an element in a list and display the frequency of
element present in list and their location using Binary Search
OUTPUT
PRACTICAL- 4
AIM- Write
a program to input n numbers in tuple and pass it to function to
count how many even and odd numbers are entered
OUTPUT
PRACTICAL- 5
AIM- Write a program to function with key and value, and update value at that key in
dictionary entered by user
OUTPUT
PRACTICAL- 6
AIM- Write a program to pass a string to a function and count how many
vowels present in the string
OUTPUT
PRACTICAL- 7
AIM- Write a program to generator that generates random numbers
between 1 and 6 using user defined function
OUTPUT
PRACTICAL- 8
AIM- Program to implement Queue in Python using List.
OUTPUT
**** QUEUE DEMONSTRATION ******
0. ENQUEUE
1. DEQUEUE
2. PEEK
3. SHOW QUEUE
0. EXIT
PRACTICAL- 9
AIM- Write a program to implement python string functions
OUTPUT
PRACTICAL- 10
AIM- Write a program to read and display file content line by line with each
word separated by #.
OUTPUT
PRACTICAL- 11
AIM- Write a 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”
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 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
OUTPUT
PRACTICAL- 14
AIM- Write a programto 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
desc student;
INSERTING VALUE
insert into student values
(1, "Akhil", "XII", "A", "Science"),
(2, "Satya", "XII", "C", "Science"),
(3, "Antony", "XII", "D", "Commerce"),
(4, "Vishal", "XII", "E", "Humanities"),
(5, "Deepak", "XII", "A", "Science"),
desc student;
UPDATING VALUE
update student set Substream = "Computer Science" where roll = 1; update student set
Substream = "Biology" where roll = 2;
update student set Substream = "Maths" where roll = 3; update student set Substream = "NA"
where roll = 4;
update student set Substream = "Computer Science" where roll = 5; update student set
Substream = "Computer Science" where roll = 6;
ORDER BY COMMAND
select studentname,section from student order by Percentage;
AVERAGE COMMAND
select avg(Percentage) from student;
COUNT COMMAND
select count(*) from student;
PRACTICAL- 15
AIM- Write a programto Integrate SQL with Python by importing the MySQL
module record of employee and display the record.
OUTPUT
PRACTICAL- 16
AIM- Write a program to 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.
OUTPUT
PRACTICAL- 17
AIM- Write a program to Integrate SQL with Python by importing the MySQL
module to search a student using roll no, update the record
OUTPUT
PRACTICAL- 18
AIM- Write a program to Integrate SQL with Python by importing the MySQL
module to search a student using roll no, delete the record.
OUTPUT
PRACTICAL- 19
AIM- Write a program to Take a sample of ten phishing e-mails (or any text
file) and find most commonly occurring word(s)
OUTPUT