Professional Documents
Culture Documents
Hridey Jain XI-A Practical File
Hridey Jain XI-A Practical File
PRACTICAL FILE
2021-2022
INDEX
1|Page
Progra Programs Page Signature
m Number
Numbe
r
1. Read two strings and check if string1 is 4
prefix, postfix or nothing from the string2
2. Write a program to read a string and print 5
PROGRAM 1
Read two strings and check if string1 is prefix, postfix or nothing from the
string2
3|Page
Solution 1:
Output 1:
PROGRAM 2
Write a program to read a string and print
4|Page
Solution 2:
Output 2:
PROGRAM 3
Create menu driven program to encrypt and decrypt
Solution 3:
5|Page
Output 3:
PROGRAM 4
Write a program to sort a given list of numbers and print the total number of
operations taking place while sorting the given list using
i) Bubble Sort
6|Page
ii) Insertion Sort
Solution 4:
PROGRAM 5
Write a program which takes 2 digits, X, Y as input and generates a 2-
dimensional array. The element value in the i th row and jth column of the array
should be i*j.
7|Page
Solution 5:
Output 5:
PROGRAM 6
Write a program to generate a random 6 digits secure OTP. The digits should
not repeat.
Solution 6:
8|Page
Output 6:
PROGRAM 7
Write a program to find the second largest number in a given list.
Solution 7:
9|Page
Output 7:
PROGRAM 8
Write a program that takes a list of words and creates a dictionary with word as
the key and number of occurrences of the word as the value.
Solution 8:
10 | P a g e
Output 8:
PROGRAM 9
Write a program to create a dictionary of names of flowers as keys and the
colours in which they exist as values in tuples, for example D={'rose':
('red','black','pink'),'lily':('white','violet')} . Now write a code to print
11 | P a g e
a) The flower which exists in maximum number of colors
b) The colour in which most of the flowers exist
Solution 9:
PROGRAM 10
Solution 10:
12 | P a g e
13 | P a g e