Panther
Panther
DELHI-110088
PGT(COMPUTER SCIENCE)
INDEX
12. Write a program to generate random number from 1 to
6, simulating a dice.
13. Write program to implement Stack in Python using list.
14. Write a program to take 10 sample phishing email, and
find the most common word occurring.
15. Write a program to connect with database and store
record of employee and display records.
16. Write a program to connect with database and search
employee number in table employee and display record,
if empno not found display appropriate message.
17. Write a program to connect with database and update
the employee record of entered empno.
18. Write a program to connect with database and delete
the record of entered employee number
19. Create a student table with the student id, name, and
marks as attributes where the student id is the primary
key.
20. Insert the details of a new student in the above table
21. Delete the details of a particular student in the above
table.
22. Find the total number of customers from each country
in the table (Customer ID, Customer Name, Country)
using group by.
1. Write a python program using a function to print factorial number series
from n to m numbers.
Code:
Output:
2. Write a python program to accept username “Admin” as default argument
and password 123 entered by user to allow login into the system.
Code:
Output:
3. Write a python program to demonstrate the concept of variable length
argument to calculate product and power of the first 10 numbers.
Code:
Output:
4. Create a text file “intro.txt” in python and ask the user to write a single line
text by user input.
Code:
Output:
File:
5. Write a program to count a total number of lines and count the total number of lines
starting with ‘A’,’B’ and ‘C’ from the file MyFile.txt.
Code:
File Content:
Output:
6. Write a program to replace all spaces from the text with – (dash) from the file
intro.txT.
Code:
OUTPUT:
7. Write a program to know the cursor position and print the text according to
below given specifications:
Code:
Output:
8. Create a binary file client.dat to hold records like ClientID, Client Name and
Address using the dictionary. Write functions to write data, read them and print
on the screen.
Code:
Output:
9. Write a program to create a binary file sales.dat and write a menu driven
program to do the following:
1. Insert Record
2. Search Record
3. Update Record
4. Display Record
5. Exit
Code:
Output:
10. Write a function to write data into binary file marks.dat and display the
records of students who scored more than 95 marks.
Code:
Output:
11. Write a program to create CSV file and store empno,name ,salary and search
any empno and display name ,salary and if not found appropriate message.
Code:
Output:
12. Write a program to generate random number from 1 to 6, simulating a dice.
Code:
Output:
13. Write a program to implement Stack in python using list.
Code:
Output:
14. Write a program to take 10 sample phishing email, and find the most
common word occurring.
Code:
Output:
15. Write a program to connect with database and store record of employee
and display record.
Code:
Output:
16. Write a program to connect with database and search employee number in
table employee and display record, if empno not found display appropriate
message.
Code:
Output:
17. Write a program to connect with database and update the employee record
of entered empno.
Code:
Output:
18. Write a program to connect with database and delete the record of entered
employee number.
Code:
Output:
19. Create a student table with the student id name and mark as attributes
where the student id is the primary key.
Code:
22. Find the total number of customers from each country in the table customer
ID customer name country using group by.
TABLE: