Cs 2023
Cs 2023
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 02 questions carrying 04 marks each
7. Section E has 03 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
Section-A
16. STR=”RGBCOLOR”
colors=list(STR)
How do we delete ‘B’ in given list colors?
a) del colors[2] b) colors.remove(“B”)
c) colors.pop(2) d) all of these
17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
a) Both A and R are true and R is the correct explanation for A
b) Both A and R are true and R is not the correct explanation for A
c) A is True but R is False
d) A is false but R is True
17. choose correct option:
D1={‘A’: ‘CS’, ‘B’: ‘IP’}
D2={‘B’: ‘IP’, ‘A’: ‘CS’}
Assertion(A): Output of print(D1==D2) is True.
Reasoning(R): Dictionary is a collection of key-value pairs. It is not a sequence.
18. Assertion (A): Comments are non-executable statements that enables the users to understand the
program.
Reasoning(R): They are basically statements used to put remarks. The comments are used to
explain the code and to make it more informative for the user.
Section-B
22. How is the pop() function different from remove() function working with list in python?
(write any two difference)
23. Write any two differences between break and continue statement.
26. What possible output(s) are expected to be displayed on screen at the time of execution of the
program from the following code?
import random
LST=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70]
first=random.randint(3, 8)-1
second= random.randint(4, 9)-2
thrid=random.randint(6, 11)-3
print(LST(first), “#”, LST(second), “#”, LST(third), “#”)
a) 20#25#25# b) 30#40#70#
c) 15#60#70# d) 35#40#60#
Specify the maximum values that can be assigned to each of the variable second and third in the
code given.
27. Write a program to input names of n students and store them in a tuple. Also input a name from
the user and find if the student is present in the tuple or not.
28. Go through the program of a dictionary in python given below and predict the output of the program
Student={“RollNo”:10, “Name”: “Kuku”, “Class”:11, “Age”:15}
T=len(Student)
elm=Student.get(“Name”)
mylist= Student.items( )
print(“length=”, T)
print(“Specific element”, elm )
print(“My list=”, mylist)
30. What is difference between sort() and sorted() function in python. Explain with an example.
Std. 11 page 4 COMPUTER SCIENCE
Section-D
31. Write a python program to input a string and replace all blank spaces by ‘$‘symbol. Display the
original string and modified string.
32. Write a python program to input 10 number to store in the list and print the third largest number.
For example, if the entered numbers in the list are 36, 25, 14, -951, 75, -25, 654, 88, 9521, 674,
then output will be
The third largest number is: 654
Section-E
34. Mr. Rajesh Kumar is a teacher in a school. He is doing his work manually. As a python teacher solve
the problem of Rajesh Kumar by python program.
a) Create a dictionary student which ask student roll number, Name and Marks of students and
display them in tabular format.
b) Display the names of those students who have secured marks more than 75.
c) Delete those students who have secured less than 50 marks.
35. Which string method is used to implement the following and also write the type of value returned by
them.
a) to count the number of characters in a sting.
b) to change the first letter of the string in capital letter.
c) to change lowercase to uppercase letter.
d) to check whether the given character is letter or number.
e) to replace all the occurrence of the old string with the new string.
-x-x-x-x-x-x-x-