You are on page 1of 4

DPS RUBY PARK, KOLKATA

CLASS XI (TERM-2)
COMPUTER SCIENCE BOARD PRACTICAL FILE
Submission Deadline: 31ST JANUARY, 2022
If you submit any time after the deadline, you will not receive full credit points

1. Write a python program that inputs a list of numbers and shifts all the zero’s to
right and all non-zero numbers to left of the list.
Example:
Enter a list
[6,8,-5,0,4,0,-2]
The result is
[6,8,-5,4,-2,0,0]

2. Write a python program to


i. Find the second largest number of a list.
ii. Display the duplicate numbers from the list.
Example:
Enter a list
[9,5,8,12,7,8]
The second largest number is 9
The duplicate number is 8
3. Write a Program to input two lists and perform the following operations:
1. Display the list having maximum number of elements
2. Display the union of two lists

Example:
Enter first list
[9,5,6,9,2]
Enter second list
[8,5,2,9]
The list having max no. of elements is [9,5,6,9,2]
The union is
[2,5,6,8,9]

4. Find the sum of each row of matrix of size m x n. For example for the following matrix
output will be like this :

Sum of row 1 = 32
Sum of row 2 = 31
Sum of row 3 = 63

5. WAP to take input of a tuple and perform the following operations:


1. Display the second largest number from the tuple
2. Display duplicate numbers from the tuple
3. Display the highest frequency number
6. Write a Python program to convert a given tuple of positive integers into an integer.
Original tuple:
(1, 2, 3)
Convert the said tuple of positive integers into an integer:
123
Original tuple:
(10, 20, 40, 5, 70)
Convert the said tuple of positive integers into an integer:
102040570

7. WAP to input a list of numbers and print those numbers which are coming consecutively 3
times.
Example:
Input a list
[2,3,4,5,5,5,6,7]
The number coming consecutively 3 times is 5

8. Given a string and a number N, we need to mirror the characters from the N-th position
up to the length of the string in alphabetical order. In mirror operation, we change ‘a’ to
‘z’, ‘b’ to ‘y’, and so on.
Examples:

Input : N = 3
paradox
Output : paizwlc
We mirror characters from position 3 to end.

Input : N = 6
pneumonia
Output : pneumlmrz

9. WAP to input phone id and username in the form of a dictionary and display those ids
which start with 91.
Example:
Suppose the dictionary contains the data as follows
{9123:”Raj”,9234:”Rahul”,9189:”Preeti”}
So the ouput would be
[9123,9189]

10. Write a Python program to create a dictionary from a string.


Note: Track the count of the letters from the string.
Sample string : 'resource'
Expected output: {'r': 2, 'e': 2, 's': 1, 'o': 1, 'u': 1, 'c': 1}
PROCEDURE OF SUBMISSION OF FILE:

• Students are required to run these programs in the Python Compiler.


Then take screenshot of both the program and output screen.

• Paste the screen shot of the program and output in the word file and
make a pdf file from it.

• Then name the pdf file as 11Q_RohitBanerjee_PRCFILE if the student


belongs to 11Q and his name is Rohit Banerjee.

• Then send this pdf to respective subject teacher’s Email id.

You might also like