Practical FIle
Practical FIle
SESSION :
NAME :
CLASS :
BOARD ROLL NO :
2
INDEX
S NO. PROGRAMMES PAGE NO.
1. WAP to modify the employee record with the 10
following dictionary structure:
{“Empno”:1234, ”Name”:”ABC”,
“Salary”:4000, ”Desig”: ”President”}
2. WAP to modify the employee record with the 11
following dictionary structure: {1234:
{”Name”: ”ABC”, “Salary”: 4000, ”Desig”:
”President”}}
3. Append the employee records in the above 12
binary file.
4 WAP using function to check whether the 13
passed number is a perfect number or not.
Return true or false. Example 6: 1+2+3 (Sum
of all positive divisors)
5. Write a function that prints the first n rows of 14
Pascal’s triangle.
6. Write a function that takes amount-in-dollars 14
and dollar-to-rupee conversion price; it then
returns the amount converted to rupees.
Create the function in both void and non-void
forms.
3
c. height of box.
Test it by writing a complete program to
invoke it.
4
each word separated by a ‘#’.
5
25. WAP to copy only those lines from abc.txt 24
which start with ‘T’ to dup.txt
6
34 Write a MySQL connectivity program in 35
Python to connect the given database and
table
7
C. Display movie id, movie name and
production cost for all movies with
production cost greater than 150000 and
less than 1000000.
D. Display the movie of type action and
romance.
E. Display the list of movies which are
going to release in February, 2022.
8
b. Create a table “TEAM” with following
considerations:
● TeamID for storing an integer value
between 1 to 9, which refers to unique
identification of a team.
● TeamName which should be a string of
length not less than 10 characters.
9
38. Queries (Based on Two Tables) 44
10
B. Display maximum price of items for each
dealer individually as per dcode from
stock.
C. Display all the items in descending
orders of item names.
D. Display average price of items for each
dealer individually as per dcode from
stock which average price is more than
5.
E. Display the sum of quantity for each
dcode.
TERM-I
11
Output
12
2. WAP to modify the employee record with the
following dictionary structure: {1234:
{”Name”:”ABC”,“Salary”:4000,”Desig”:”President”}
}
13
Output
14
3. Append the employee records in the above binary
file.
Output
15
4. WAP using function to check whether the passed
number is a perfect number or not. Return true or
false. Example 6: 1+2+3 (Sum of all positive divisors)
Output
16
Output
17
Output
Output
18
Output
Output
19
. lowercase and uppercase alphabets of the passed
string.
Output
Output
20
Output
Output
21
Output
Output
Output
22
17 WAP in python to calculate number of vowels in the
. file abc.txt
Output
Output
23
all other characters should appear as it is.
Output
Output
24
Output
25
Output
Output
26
a. file1.txt contains the name of students starting
with ‘A’ to ‘M’
b. file2.txt contains the name of students starting
with ‘N’ to ‘Z’
Output
27
Output
28
Output
Output
29
Output
30
Output
31
TERM-II
32
Output
33
32 Write a program to implement a stack for the
. employee details in tuple (empno, name) as an
element of the stack.
34
Output
35
36
33 Write a python program to check whether a string is
. a palindrome or not using stack.
Output
37
34 Write a MySQL connectivity program in Python to
. connect the given database and table
38
Output
39
40
35 Observe the following table :
.
41
E. Display the list of movies which are going to
release in February, 2022.
A.
B.
C.
D.
E.
42
36 Queries based on functions :
.
A. Write a query to display cube of 5.
B. Write a query to display the number 563.854741
rounding off to the next hundred.
C. Write a query to display “put” from the word
“Computer”.
D.Write a query to display today’s date into
DD.MM.YYYY format.
E. Write a query to display ‘DIA’ from the word
“MEDIA”.
F. Write a query to display movie name – type from
the table movie.
G.Write a query to display first four digits of
production cost.
H.Write a query to display last four digits of
business cost.
I. Write a query to display weekday of release
dates.
J. Write a query to display day name on which
movies are going to be released.
A. B
B.
43
C.
B D.
E. BF.
G.
B H.
I. BJ.
37 DDL Commands :
44
.
a. Create a database “Sports”.
b. Create a table “TEAM” with following
considerations:
● TeamID for storing an integer value between 1
to 9, which refers to unique identification of a
team.
● TeamName which should be a string of length
not less than 10 characters.
45
a.
b.
c.
d.
e.
f.
46
g.
A.
47
B.
C.
D.
E.
48
39 Queries (Group by , Order By)
. Consider the following table stock table to answer
the queries:
A.
49
B.
C.
D.
E.
50