Professional Documents
Culture Documents
Student Upload File 1683283145
Student Upload File 1683283145
Index
Program Number Title
Program-1 Basics of Python-Phishing E-Mail
Program-2 Functions- Printing Factorial/Fibonacci/Prime Number
Program-3 Built in Module-Using Statistics/Random module
Program-4 Text File-1- Manipulating lines
Program-5 Text File-2 -Analysing characters
Program-6 Text File-3 – Manipulating words
Program-7 Binary File-1 – Inserting, Displaying and Searching with list
Program-8 Binary File-2 - Inserting, Displaying and Deleting with list
Program-9 Binary File-3 - Inserting, Displaying and Updating with
Dictionary
Program-10 CSV File-1 – Inserting, Displaying and Updating with list
Program-11 CSV File-2 - Inserting, Deleting and displaying with list
Program-12 CSV File-3 - Inserting, Searching and Displaying with List
Program-13 Stack-1-Push, Pop and Display with list
Program-14 Stack-2-Push and Peek with list
Program-15 Stack-3- Push, count of stk_ele and Display with dictionary
Program-16 PYTHON-SQL CONNECTIVITY-1
Program-17 PYTHON-SQL CONNECTIVITY-2
Program-18 PYTHON-SQL CONNECTIVITY-3
Program-19 PYTHON-SQL CONNECTIVITY-4
Program-20 PYTHON-SQL CONNECTIVITY-5
Program-21 PYTHON-SQL CONNECTIVITY-6
Note:
Write the Title, Question, Aim ,Code and Result on the R.H.S.(with blue ink) of your
observation notebook & record note book, the output alone on the L.H.S.(will be given
later).Open the link of Python program in laptop or desktop to see the code. Start every
exercise on a fresh page
1
Program 1:
Title: Basics of Python-Phishing E-Mail
Question: Write a Program to take 10 sample phishing emails and find the most common
occurring domain.
AIM: To write a Program to take 10 sample phishing emails and find the most common
occurring domain.
CODE:
https://drive.google.com/file/d/1u0lcPxuHzW5spMlcLSkKaBx8iCXXBj2z/view?usp=share_link
Result: The above program is executed successfully and the output is verified
2
Program 2:
Title: Functions- Printing Factorial/Fibonacci/Prime Number
Question: Write a program to calculate the factorial value or to print the Fibonacci series for
n terms or check whether the entered no. is prime or not based on users’ choice.
AIM:
To write a menu driven program
1. to calculate the factorial value
2. to print the Fibonacci series for n terms
3. to check whether the entered no. is prime or not.
CODE: https://drive.google.com/file/d/1RKBVdA1fstjSQlhb2um5UkGbhzezPFWY/view?
usp=share_link
Result: The above program is executed successfully and the output is verified
3
Program:3
Title: Built in Module-Using Statistics/Random module
Question: Write a Program to use the functions from Statistics and Random modules.
Aim: To write a menu – driven program to import and use the below modules.
1.Statistics
2.Random
CODE:
https://drive.google.com/file/d/1vfR7DkXCG9-g9hP3SlPHdUiCYlffNDXP/view?usp=share_link
Result: The above program is executed successfully and the output is verified
4
Program 4 :
Title: Text File-1- Manipulating lines
Question: Write a text file handling program in python to do the following
1. To read a text file line by line and display each word separated by a #.
2. To remove all the lines that contain the character `W’ from a file and write it to another
file
AIM: To write a menu – driven program to perform the following on a text file
1. To write a python function to read a text file line by line and display each word
separated by a #.
2. To write a python function to remove all the lines that contain the character `W’
from a file and write it to another file
CODE:
https://drive.google.com/file/d/16Yr-e-l8_785RP6rlcpSl9hzAFlkfQTE/view?usp=share_link
Result: The above program is executed successfully and the output is verified
5
Program 5:
Title : Text File-2 -Analysing characters
Question: Write a text file handling program in python to do the following
1. Display the number of vowels
2. Display the number of consonants
3. Display the number of upper-case characters
4. Display the number of lower-case characters
AIM:
To write a menu – driven program to perform the following on a text file
1. Display the number of vowels
2. Display the number of consonants
3. Display the number of upper-case characters
4. Display the number of lower-case characters
CODE:
https://drive.google.com/file/d/1TPPNBwqYgQO5HBqLfl6LsQzoy6nLsHDN/view?usp=share_link
Result: The above program is executed successfully and the output is verified
6
Program 6:
Title: Text File-3 – Manipulating words
Question: Write a text file handling program in python to do the following
1. Counting the specific word in a file
2. Replace the given word with another word
3. Display the words ending with character 'e'
4. Display the longest word of the file
AIM:
To write a menu – driven program to perform the following on a text file
1. Counting the specific word in a file
2. Display the text after replacing the given word with another word
3. Display the words ending with character 'e'
4. Display the longest word of the file
CODE:
https://drive.google.com/file/d/18RF9KkhkCVzGRLuB2qyiEkI2LYjzS1_q/view?usp=share_link
Result: The above program is executed successfully and the output is verified
7
Program 7:
Title: Binary File-1 – Inserting, Displaying and Searching with list
Question: Write a Program to create a product record on a binary file.
AIM: To write a python
1.Insert record
2.Display record
3.Search record
4.Exit
CODE:
https://drive.google.com/file/d/1ZMM3S_5Y1AF5xNpt_io_I_Bu96hxsqil/view?usp=share_link
Result: The above program is executed successfully and the output is verified
8
Program 8:
Title : Binary File-2 - Inserting, Displaying and Deleting with list
Question: Write a Program to Create a Employee Record on a Binary File.
AIM:
To write a menu – driven program to perform the following tasks on a Binary file
1.Insert record
2.Display record
3.Delete record
4.Exit
CODE:
https://drive.google.com/file/d/1mCEZhqjz9I28ZuHCWP2Q2pIZsyvPz-X2/view?usp=share_link
Result: The above program is executed successfully and the output is verified
9
Program 9:
Title : Binary File-3 - Inserting, Displaying and Updating with Dictionary
Question: Write a Program to Create a Student Record on a Binary File.
AIM:
To write a menu – driven program to perform the following tasks on a Binary file
1.Enter data
2.Display data
3.Update data
4.Exit
CODE:
https://drive.google.com/file/d/1d5K2-3nmhmfxGZPA7nPFsznLMlwLHf-W/view?usp=share_link
Result: The above program is executed successfully and the output is verified
10
Program -10:
Title : CSV File-1 – Inserting, Displaying and Updating with list
Question: Write a Program to Create a Customer record with CSV file.
AIM:
To write a menu – driven program to perform the following tasks on a CSV file
1-Add record
2-Display records
3-Modify record
4-Exit
CODE:
https://drive.google.com/file/d/16m2LVWzE5ydfAKq-dzjFkJ0S2UN_LFlo/view?usp=share_link
Result: The above program is executed successfully and the output is verified
11
Program -11:
Title : CSV File-2 - Inserting, Deleting and displaying with list
Question: Write a Program to Create a Book Details Record using CSV file.
AIM:
To write a menu – driven program to perform the following tasks on a CSV file
1. Add New Book
2. Display Books in sorted order
3. Delete Book
4. Quit
CODE:
https://drive.google.com/file/d/1mX-9jgIN5u46OhARZKEjtyRX0ElFV-i_/view?usp=share_link
Result: The above program is executed successfully and the output is verified
12
Program -12:
Title : CSV File-3 - Inserting, Searching and Displaying with List
Question: Write a Program to Create a record of user credentials using CSV file.
AIM:
To write a menu – driven program to perform the following tasks on a CSV file
1: Create
2: Search
3: Display
4: Exit
CODE:
https://drive.google.com/file/d/1E2AKA0kH28ArcKh5ef6rZF6QLFTo5bfl/view?usp=share_link
Result: The above program is executed successfully and the output is verified
Program -13:
13
Title : Stack-1-Push, Pop and Display with list
Question: Write a Program to Create and perform all basic operations of Stack with list of
numbers
AIM:
To write a menu – driven program to perform the following tasks on a number Stack.
STACK OPERATIONS
1: PUSH the elements divisible by 5
2: POP
3: Display
4: Exit
CODE:
https://drive.google.com/file/d/1mHBwxCgOxBEI_SppfNHjH4t3BHoKC7Gz/view?usp=share_link
Result: The above program is executed successfully and the output is verified
Program -14:
14
Title : Stack-2-Push and Peek with list
Question: Write a Program to Create and perform all basic operations of Stack with
customer details
AIM:
To write a menu – driven program to perform the following tasks on a
Customer[Customer_name, Phone_number, City] Stack
1: PUSH - The customer details based on city
2: PEEK
3: EXIT
CODE:
https://drive.google.com/file/d/1D5PNGSHzTJ8j6sn2Wmx4dR6IZbcKqzq5/view?usp=share_link
Result: The above program is executed successfully and the output is verified
Program -15:
15
Title : Stack-3- Push, count of stk_ele and Display with dictionary
Question: Write a Program to Create and perform all basic operations of Stack with
dictionary {pname:price}
AIM:
To write a menu – driven program to perform the following tasks on a product Stack
STACK OPERATIONS
1: PUSH Product names with price > 75
2: Count the no. of elements in stack
3: Display
4: Exit
CODE:
https://drive.google.com/file/d/1zpQ197lynswzZmiyUW2VmohYuWSuP_fc/view?usp=share_link
Result: The above program is executed successfully and the output is verified
Program -16
16
Title: PYTHON-SQL CONNECTIVITY-1
Question :Write a menu driven program to perform the following task on “XII”
database:
i) Creating the following table “CARDEN”
ii) Inserting the given records
Ccode CarName Make Color Capacity Charges
501 A-Star Suzuki RED 3 14
503 Indigo Tata SILVER 3 12
502 Innova Toyota WHITE 7 15
509 SX4 Suzuki SILVER 4 14
510 C Class Mercedes RED 4 35
AIM :
To write a menu driven program to perform the following task on “XII” database .
CODE:
https://drive.google.com/file/d/14efirkjCzbdSDqgtyCL_d-v80id5CXf4/view?usp=share_link
Result: The above program is executed successfully and the output is verified
Program -17
Title: PYTHON-SQL CONNECTIVITY-2
17
Question : Write a menu driven program to perform the following task on “XII”
database:
i) Creating the following table “SPORTS”
ii) Inserting the given records
Stud_no Class name game1 grade1
10 7 Sameer Cricket B
11 8 Sujith Tennis A
12 7 Kamal Swimming B
13 7 Venna Tennis C
14 9 Archana Basketball A
15 10 Arpit Cricket A
iii) Query 1: To display the name of students with game as swimming
iv) Query 2: To delete the rows where class is 10
v) Query 3: To display the number of students from each class.
AIM:
To write a menu driven program to perform the following task on “XII” database.
CODE:
https://drive.google.com/file/d/1J3gZYbCsnRoqfRu3rPUOrx2oGvLtatV0/view?usp=share_link
Result: The above program is executed successfully and the output is verified
Program -18
18
Title:PYTHON-SQL CONNECTIVITY-3
Question : Write a menu driven program to perform the following task on “XII”
database:
i) Creating the following table “ORDERS”
ii) Inserting the given records
OderID Pname Quantity Rate Sale_date Discount
1001 Pen 10 20 2019-10-05 NULL
1002 Pencil 20 10 2019-10-21 NULL
1003 Book 10 100 2019-11-12 50
1004 Eraser 100 5 2019-12-05 25
1005 Copy 50 20 2019-12-10 NULL
iii) Query1:To display Pname, Quantity and Rate for all the orders that are either pen
or pencil
iv)Query2:To display orders which are not getting any discount
v) Query3: Update Rate by 5%.
AIM:
To write a menu driven program to perform the following task on “XII” database
CODE:
https://drive.google.com/file/d/17FAgVmcy7dPOH5U5pSHou0dS7kjVeUnr/view?usp=share_link
Result: The above program is executed successfully and the output is verified
19
Program -19
Title:PYTHON-SQL CONNECTIVITY-4
Question : To write a menu driven program to perform the following task on “XII”
database:
i) Creating the following table “STUDENT”
ii) Inserting the given records
iii) Query 1: To display the records from table student in alphabetical order as per the
name of the student.
iv) Query 4: To display Class, Dob and City whose marks is between 450 and 551.
v) Query 5: To display the highest marks
AIM:
To write a menu driven program to perform the following task on “XII” database:
CODE:
https://drive.google.com/file/d/15NGjO7k8_1rzGB8LIKALB28XYY9BGEuL/view?usp=share_link
Result: The above program is executed successfully and the output is verified
20
Program -20
Title:PYTHON-SQL CONNECTIVITY-5
Question :Write a menu driven program to perform the following task on “XII” database:
i) Creating the following table “EMPLOYEE”
ii) Inserting the given records
Fcode Fname Sex Salary Subject JoinDate
F1001 Hari Charan M 101000 English 2000-10-11
F1004 Mallika F 202000 Programming 2003-11-30
F1002 Arun M 202000 Web design 2001-09-06
F1005 Priya F 201000 Web design 2004-12-15
F1009 Tanya F 203000 Programming 2006-12-31
F1006 Amar M 108000 Data structure 2005-05-02
F1008 Avinash M 105000 Maths 2002-03-15
iii) Query 1: To display Fcode, Fname, JoinDate, Salary of all faculty members in
descending order of their salary.
iv) Query 2: To increase the salary of all faculties by 2000, who are either teaching the
subject “Programming” or teaching the subject “Maths”.
v) Query 3: To display details of all faculty whose name ends with letter “n”.
AIM:
To write a menu driven program to perform the following task on “XII” database:
CODE:
https://drive.google.com/file/d/1eSE1Y6L8Ty7dZtrIjYiv52O6TN0Bx-ef/view?usp=share_link
Result: The above program is executed successfully and the output is verified
21
Program -21
Title:PYTHON-SQL CONNECTIVITY-6
Question : Write a menu driven program to perform the following task on “XII”
database:
i) Creating the following table “ITEMS”
ii) Inserting the given records
ItemNo Name Dcode Qty UnitPrice StockDate
5005 CD 101 100 25 2010-03-31
5003 Floppy 101 150 10 2010-01-01
5002 Pendrive 101 125 200 2010-02-14
5006 Mouse 102 200 300 2009-03-19
5001 Keyboard 102 60 400 2009-12-19
iii) Query1: Display the Item name with stockdate in the year 2010.
iv) Query2: To display the ItemNo and name of those items from the above table whose
Unitprice is more than Rs10.
v) Query 3: To display the total Qty of each Dcode.
AIM:
To write a menu driven program to perform the following task on “XII” database
CODE:
https://drive.google.com/file/d/1XxuP6wGMBYNGRt9oY468B6YzzaAYMeCM/view?usp=share_link
Result: The above program is executed successfully and the output is verified
3. To delete a database:
mysql>DROP database <databasename>;
5. To remove table:
mysql>droptable <tablename>;
6. To show list of tables in opened database:
mysql>SHOW TABLES;
19. To select rows using Like operator with relational and logical operator:
mysql>SELECT Name,City FROM Student WHERE Class>=8 AND Name LIKE ‘%Kumar%’;
20. To display data after removal of duplicate values from specific column:
mysql>select distinct class from student;
25
32. To display the records in ascending order.
mysql>select * from student order by class;
mysql>select*from student order by class asc;
26
39. To group the records by column name with aggregate functions:
mysql>select class,count(*) from student group by class;
mysql>select class,avg(marks) from student group by class;
40. To group the records by column with aggregate functions (with where and order by clause):
mysql>select class,avg(marks) from student where class<10 group by class order by marks
desc;
42. To group there cords with aggregate functions & having clause:
mysql>select class,avg(marks) from student group by class having avg(marks)<90;
mysql>select class,avg(marks) from student group by class having count(*)<3;
28