You are on page 1of 4

KENDRIYA VIDYALAYA NO.

1, Bokaro
Computer Science Class 12 (Python)
List of Practical’s
S. PRACTICAL
No.
1. Write a program that multiplies two integer numbers
without using the * operator, using repeated addition.
2. Program that reads a line and prints its statistics like:
Number of uppercase letters:
Number of lowercase letters:
Number of alphabets:
Number of digits:
3. Write a program to create a dictionary containing
names of competition winner students as keys and
number of their wins as values.
4. Program to sort a list using Bubble sort.
5. Program that receives two numbers in a function and
returns the results of all arithmetic operations (+, -, *,
/, %) on these numbers.
6. Passing a Mutable Type Value to a function – Assigning
parameter to a new value/variable.
7. Write a program file that inputs a real number and
converts it to nearest integer using two different built-
in functions. It also displays the given number rounded
off to 3 places after decimal.
8. Create a file to hold some data.
9. Write a program to get roll numbers, names and marks
of students of class (get from user) and store these
details in a file called “Marks.det”.
10. Program to calculate a^b using iterative code.
11. Program using a recursive function to print Fibonacci
series upto nth term.
12. Create an array in the range 1 to 20 with values 1.25
apart. Another array contains the log values of the
elements in first array.
(a) Simply plot the two arrays first vs second in a line
chart.
(b) In the plot of first vs second array, specify the x-
axis (containing first array’s values) title as
‘Random Values’ and y-axis title as ‘Logarithm
Values’.
(c) Create a third array that stores the COS values of
first array and then plot both the second and
third array vs first array. The Cos values should
be plotted with a dashdotted line.
(d) Change the marker type as a circle with blue
colour in second array.
(e) Only mark the data points as this: second array
data points as blue small diamonds, third array
data points as black circles.
13. Val is a list having three lists inside it. It contains
summarized data of three different trials conducted by
company A. Create a bar chart that plots these three
sublists of Val in a single chart. Keep the width of each
bar as 0.25.
14. TSS school celebrated volunteering week where each
section of class XI dedicated a day for collecting
amount for charity being supported by the school.
Section A volunteered on Monday, B on Tuesday, C on
Wednesday and so on. There are six sections in class
XI. Amount collected by sections A to F are 8000,
12000, 9800, 11200, 15500, 7300.
(a) Create a bar chart showing collection amount.
(b) Plot the collected amount vs days using a bar
chart.
(c) Plot the collected amount vs sections using a bar
chart.
15. Binary Searching in an array.
16. Python program to implement stack operations.
17. Consider the following table named “GARMENT”.
Write command of SQL for (i) to (iv).
Table: GARMENT
GCODE GNAME SIZE COLOUR PRIZE
111 TShirt XL Red 1400.00
112 Jeans L Blue 1600.00
113 Skirt M Black 1100.00
114 Ladies Jacket XL Blue 4000.00
115 Trousers L Brown 1500.00
116 Ladies Top L Pink 1200.00
(i) To display names of those garments that are
available in ‘XL’ size.
(ii) To display code and names of those garments
that have their names starting with ‘Ladies’.
(iii) To display garment names, code, prices of
those garments that have price in the range
1000.00 to 1500.00 (both 1000.00 and 1500.00
included).
(iv) To change the colour of garment with code as
116 to “Orange”.
18. Given the following table:
Table: CLUB
COACH- COACH AGE SPORTS DATOF PAY SEX
ID NAME APP
1. KUKREJA 35 KARATE 27/03/96 1000 M
2. RAVINA 34 KARATE 20/01/98 1200 F
3. KARAN 34 SQUASH 19/02/98 2000 M
4. TARUN 33 BASKETBALL 01/01/98 1500 M
5. ZUBIN 36 SWIMMING 12/01/98 750 M
6. KETAKI 36 SWIMMING 24/02/98 800 F
7. ANKITA 39 SQUASH 20/02/98 2200 F
8. ZAREEN 37 KARATE 22/02/98 1100 F
9. KUSH 41 SWIMMING 13/01/98 900 M
10. SHAILYA 37 BASKETBALL 19/02/98 1700 M
Give the output of following SQL statements:
(i) SELECT COUNT (DISTINCT SPORTS) FROM Club;
(ii) SELECT MIN(Age) FROM CLUB WHERE Sex = ‘F’;
(iii) SELECT AVG(Pay) FROM CLUB WHERE Sports =
‘KARATE’;
(iv) SELECT SUM(Pay) FROM CLUB WHERE
Datofapp > ‘31/01/98’;

You might also like