12th Practical File
12th Practical File
SCHOOL,
KAVESAR, THANE (W)
COMPUTER SCIENCE(083)
PRACTICAL FILE
with
2021 – 2022
Submitted By:
NAME: Prathamesh Kulkarni
CLASS/DIV: 12th A
Roll No.: 21
Exam Seat Number:
Submitted To: Mrs Aarati Mahajan
Index
SN Program Signatur
. e
1 WAP to input a year and check whether the year is leap year or not.
2 WAP to input 3 numbers and print the greatest number using nested if.
WAP to input value of x and n and print the series of x^n along with its sum.
3
e.g x=2 n=5 (Output:x^0 x^1…x^n and sum)
4 WAP to input a number and check whether its prime number or not.
5 WAP to print Fibonacci series up to n terms, also find sum of series.
6 WAP to print the given patterns.
7 WAP to print a string and the number of vowels present in it.
WAP to input a list of numbers and search for a given number using linear search./
8
binary search.
WAP that rotates the elements of a list so that the element at first index moves to
9 the second index, the element at second index moves to the third index and so on
and the element at last index moves to the first index.
Write a program to sort a list using bubble sort and produce sorted list./bubble sort
10
for dictionary keys
Write a menu driven program which will have following functions that takes a
number
11 i) Digisum() – returns sum of digits.
ii) rev() – reverse of a number and also print whether a number is palindrome
or not.
Write function div3and5() that takes 10 elements numeric tuple and return the sum
12
of elements which are divisible by 3 and 5
Write a function that receives two numbers and generates random number from
13 that range. Using this function the main program should be able to print 3 numbers
randomly.
Write a python program to maintain book details like book code, book title and
14 price using stacks data structures? (implement push(), pop() and traverse()
functions)
Write a python program to read a file named “article.txt”, count and print the
following:
a) length of the file(total characters in file)
b) total alphabets
15 c) total upper case alphabets
d) total lower case alphabets
e) total digits
f) total spaces
g) total special characters
WAP that copies a text file “source.txt” onto “target.txt” barring the lines starting
16
with a ”@” sign.
17 A file contains a list of telephone numbers in the following form:
Ashwin 9988776655
Shweta 9994445554
WAP to read a file and display its contents in two columns.
WAP that reads characters from the keyboard one by one. All lowercase characters
18 get stored in the file “lower”, all uppercase characters get stored inside a file
“UPPER” and all other characters inside “others”.
Python file/program for interactive binary data file handling (includes
19
insert/search/update/delete operation)
20 Reading and Writing to CSV file.
Write A Program To Integrate SQL With Python By Importing The Mysql
21
Module.
22 Take A Sample Of 10 Phishing Emails And Find The Most Common Words.
23 MySQL Queries I
24 MySQL Queries II
Write A Program To Connect Python With MySQL Using Database Connectivity
25 And Perform The Following Operations On Data In Database: Fetch, Update And
Delete The Data.
QUESTION-1
WAP to input a year and check whether the year is leap year or not.
CODE:
OUTPUT :
QUESTION-2
WAP to input 3 numbers and print the greatest number using nested it .
CODE:
OUTPUT :
QUESTION-3
WAP to input value of x and n and print the series of x^n along with its
sum. e.g x=2 n=5 (Output:x^0 x^1…x^n and sum)
c
OUTPUT :
QUESTION-4
WAP to input a number and check whether its prime number or not.
CODE:
OUTPUT :
QUESTION-5
WAP to print Fibonacci series up to n terms, also find sum of series.
CODE:
OUTPUT :
QUESTION-6
WAP to print the given patterns.
CODE:
OUTPUT :
QUESTION-7
WAP to print a string and the number of vowels present in it.
CODE:
OUTPUT :
QUESTION-8
WAP to input a list of numbers and search for a given number using linear
search./ binary search.
CODE:
OUTPUT :
QUESTION-9
WAP that rotates the elements of a list so that the element at first index
moves to the second index, the element at second index moves to the
third index and so on and the element at last index moves to the first
index.
CODE:
OUTPUT :
QUESTION-10
WAP to sort a list using bubble sort and produce sorted list./bubble sort
for dictionary keys.
CODE:
OUTPUT :
QUESTION-11
Write a menu driven program which will have following functions that
takes a number
i) Digisum() – returns sum of digits
ii) rev() – reverse of a number and also print whether a number is
palindrome or not.
CODE:
OUTPUT :
QUESTION-12
Write function div3and5() that takes 10 elements numeric tuple and
return the sum of elements which are divisible by 3 and 5 .
CODE:
OUTPUT :
QUESTION-13
Write a function that receives two numbers and generates random number from
that range. Using this function the main program should be able to print 3
numbers randomly.
CODE:
OUTPUT :
QUESTION-14
Write a python program to maintain book details like book code, book
title and price using stacks data structures? (implement push(), pop() and
traverse() functions)
CODE:
OUTPUT :
QUESTION-15
Write a python program to read a file named “article.txt”, count and print the following:
a) length of the file(total characters in file) b) total alphabets
c) total upper case alphabets d) total lower case alphabets
e) total digits f) total spaces g) total special characters
CODE:
OUTPUT :
QUESTION-16
WAP that copies a text file “source.txt” onto “target.txt” barring the lines
starting with a ”@” sign.
CODE:
OUTPUT :
QUESTION-17
A file contains a list of telephone numbers in the following form:
Ashwin 9988776655
Shweta 9994445554
WAP to read a file and display its contents in two columns.
CODE:
OUTPUT :
QUESTION-18
WAP that reads characters from the keyboard one by one. All lowercase
characters get stored in the file “lower”, all uppercase characters get
stored inside a file “UPPER” and all other characters inside “others”.
CODE:
OUTPUT :
QUESTION-19
Python file/program for interactive binary data file handling (includes
insert/search/update/delete operation)
CODE:
OUTPUT :
QUESTION-20
Reading and Writing to CSV file.
CODE:
OUTPUT :
QUESTION-21
Write A Program To Integrate SQL With Python By Importing The Mysql
Module.
CODE:
OUTPUT:
QUESTION-22
Take a sample of 10 phishing Emails and find the most common words.
CODE:
OUTPUT:
QUESTION-25
Write a Program to Connect python with MYSQL using database
connectivity and perform the following operatuons on data in Database:
Fetch, Update and Delete the data