Xii Cs Set A QP Cbessc
Xii Cs Set A QP Cbessc
A
SCHOOLS COMPLEX
TERM I COMMON EXAMINATION (SEP – 2023)
GRADE: XII MARKS: 70
SUBJECT: COMPUTER SCIENCE TIME: 3 HRS
General Instructions:
1. The paper is divided into 5 Sections- A, B, C, D and E.
2. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
3. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
4. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
5. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
6. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
7. All programming questions are to be answered using Python Language only.
3. Evaluate the expression: (5<11) and (10<5) or (4<17) and not 7<17 1
a)3 4 b) 2 1 c) 4 5 d) 1 2
a) 6 4 b) 2 6 c) 4 6 d) 6 2
6. What will be the output of the following code? 1
a=[1,2,3,4,5,6]
for i in range(1,6):
a[i-1]=a[i]
for i in range(0,6):
print(a[i],end="#")
11. Reema is a well-known data specialist, she trains their group to store, read, write 1
update and delete the data based on the user requirement. One of the trainers
wants to write a data into the file from current position moving 10 bytes
backward. As a python programmer suggest the command to complete it.
12. Consider the code given below: 1
import random
r = random.randrange (100, 999, 5)
print(r, end = ‘’)
r = random.randrange(100, 999, 5)
print(r, end = ‘’)
r = random.randrange (100, 999, 5)
print(r)
Which of the following are the possible outcome(s) of the above code? Also,
what can be the maximum and minimum number generated by line 2?
a) 655, 705, 220 b) 380, 382, 505
c) 100, 500, 999 d) 345, 650, 110
Q17 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. Assertion (A): A function returns only one value at a time. 1
Reason (R): return is a keyword.
18. Assertion (A): The file access mode “a” is used to append the data in to the file. 1
Reason (R): In the access mode “a” the text will be appended at the end of the
existing file. If the file does not exist, Python will create a new file and write data
into it.
SECTION- B
19. (i) Write the full forms of the following: 2
(a) SMTP (b) IPR
(ii) Which protocol is used in creating a connection with a remote machine?
20. Rewrite the following Python program after removing all the syntactical errors (if 1+1
any), underlining each correction:
x=input (“Enter a number”)
if x % 2=0:
print x, “is even”
else if x<0:
print x, “should be positive”
else;
print x “is odd”
21. Write definition of a method ODDSum(NUMBERS) to add those values in the 2
list of NUMBERS, which are odd.
Sample Input Data of the List
NUMBERS= [20,40,10,5,12,11]
OUTPUT is 16
OR
Write a function, Wordslen(STRING), that takes a string as an argument and
returns a tuple containing length of each word of a string.
For example, if the string is "Python is an interesting language", the
tuple will have (6, 2, 2, 11, 8)
22. Predict the output: 2
Marks = {'Sidhi':65,'Prakul':62,'Suchitra':64,'Prashant':50}
newMarks = {'Suchitra':66,'Arun':55,'Prashant':49}
Marks.update(newMarks)
for key,value in Marks.items():
print(key,'scored',value,'marks in Pre Board',end= '')
if(value<55):
print('and needs imporovement' , end='.')
print()
ii)
tup1 = ("George","Anderson","Mike","Luke","Amanda")
list1 =list(tup1)
list2 = []
for i in list1:
if i[-1]=="e":
list2.append(i)
tup2 = tuple(list2)
print(tup2)
32. A binary file “vehicle.dat” has structure [RegNo, Type, Make, Year]. 4
a. Write a user defined function AddVahan() to input data for a vehicle
and add to “vehicle.dat” file.
b. Write a function CountVahan(Type) in Python which accepts the
Type of the vehicle as the parameter and count and return the
number of vehicles of the given Type.
SECTION-E
33. i) Define repeaters with its two types. 1+4
ii) Unicorp Tech Training Ltd. is a Delhi based organization which is expanding
its office set-up to Jaipur. At Jaipur office, they are planning to have 3 different
blocks for Admin, Training and Accounts related activities. Each block has a
number of computers, which are required to be connected in a network for
communication, data and resource sharing. As a network consultant, you have to
suggest the best network related solutions for them for issues/problems raised by
them in (i) to (iv), as per the distances between various blocks/locations and other
given parameters.
(i)
OR
Write a function to read the content from the file “India.txt”, and store the
frequency of each word in dictionary and display the dictionary in the screen.