naveen practical
naveen practical
VIDYALAYA NO.2
PORTBLAIR
Page 1 of 26
CERTIFICATE
………………………………………… …………………………………………..
Signature of External Examiner Signature of Internal Examiner
Name: ……………………………….. Name: M.UMASELVI
………………………………..
Signature of Principal
Name: Mr. Vishal Yadav
Place: PortBlair
Date:……………..
Page 2 of 26
OUTPUTS
PYTHON PROGRAM
1.To check the given number is prime or not.
Page 3 of 26
4.To calculate the factorial of an integer.
Page 4 of 26
8.To test if the string passed is a
palindrome or not.
Page 5 of 26
10.Menu driven program that takes a tuple
as a parameter and return max, min and
sum of the elements.
Page 6 of 26
12.To read a text file and display the number of
vowels/consonants/uppercase/lowercase/characters/digits
present in the file.
Page 7 of 26
14.To count the number of lines starting
with ‘A’.
Page 8 of 26
BINARY FILE
Page 10 of 26
Page 12 of 26
18.To read all the content of and
display records of only those students
who scored more than 80 marks.
Page 13 of 26
19.To create a CSV file and write a
menu driven Program to do the
following:
Add a record
Search a record (get emp no)
Display all
Exit
Page 14 of 26
20.To show the detail of the student
who scored the highest marks. Data
stored in “student.csv” is given
below:
Roll no, Name, Marks.
1, Aman,35 2, Kanak,1 3, Anuj,33 4,
Suman,25
Page 15 of 26
1. CONNECTIVITY PYTHON
Practical 1
Aim to connect to MySQL server
• To create a database Student
• To create a table Student
• To add 6 rows
• To fetch and display the records
OUTPUT:
Page 16 of 26
Practical 2
Aim
• To Connect to database student
• To create a table result
• To add six rows
• To increase marks in Math by 5 for Sudha
• To fetch and display the records
Output:
Page 17 of 26
• equal to 90
• To fetch and display the records
OUTPUT:
Practical 4
Aim
• To connect to database student
• To create a Table staff
• To add 6 rows
• To fetch and display the records of all
Page 16 of 26
OUTPUT:
MYSQL
1. Create database name ‘kv2’.
Page 17 of 26
4. Add the following rows in the table student.
Page 18 of 26
6. . Give the structure of the table student
Page 19 of 26
8. Display the details of all students whose name contains second
letter as ‘a’.
Page 20 of 26
9. Display the details of all students in descending order of their
names.
Page 21 of 26
12. Display the name of those students whose age is 17
and belongs to Delhi.
Page 22 of 26
15. Display the name of those students who belongs to
Delhi, Chennai or Kolkata.
Page 24 of 26
20. Display the details of all students in ascending order of
city and then in descending order of names.
Page 25 of 26
25. Increase the size of city column as 20.
Page 26 of 26