0% found this document useful (0 votes)
145 views8 pages

Xii Cs Set A QP Cbessc

ggyyyhhhhg

Uploaded by

ragubal2412
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views8 pages

Xii Cs Set A QP Cbessc

ggyyyhhhhg

Uploaded by

ragubal2412
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

COIMBATORE SAHODAYA

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.

S.NO SECTION- A MARKS


1. State True or False: 1
“In Python, a variable is a placeholder for data”.
2. Find the invalid identifier from the following: 1
a) DAY_22 b) _file c) X3T4 d) My. Sample

3. Evaluate the expression: (5<11) and (10<5) or (4<17) and not 7<17 1

4. Write the output of the following: 1


import math
x = math.ceil(1.4)
y = math.floor(1.4)
print(x,y)

a)3 4 b) 2 1 c) 4 5 d) 1 2

5. What will be the output of the following code? 1


x, y = 2, 6
x, y=y, x+2
print (x, y)

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="#")

a) 1#2#3#4#5#6#6# b) 3#4#5#6#6# c) 2#3#4#5#6#6# d) 2#3#4#5#6#

7. Given the Python declaration s1=”Python”. Which of the following statements 1


will give an error?
a) print(s1[4]) b) s2=s1 c) s1=s1[4] d) s1[4]=”X”

8. Predict the output. 1


s='Happy Morning'
print(s.capitalize(),s.title(), end='$')
a) Happy morning Happy Morning$ b) Happy morning$ happy morning$
c) Happy$ Morning$ d) b) Happy$ morning$ happy$ morning$
9. Consider the following statement 1
file1=open(“sample.txt”)
In which mode the above file will be opened.
a)append b) write and read c) read d) write only
10. Which of the following will delete key-value pair for key = “Yellow” from a 1
dictionary D2?
a) delete D2("Yellow") b) del D2["Yellow "]
c) del.D2["Yellow "] d) D2.del["Yellow "]

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

13. Consider the code given below: 1


b=50
def test(a):
______ #missing statement
b=b+a
print(a,b)
test(15)
print(b)
Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 65?
a) global a b) global b=50 c) global b d) global a=50
14. Select the correct output of the following python code: 1
str="My program is program for you"
t = str.partition("program")
print(t)
a) ('My ', 'program', ' is ', 'program', ' for you')
b) ('My ', 'program', ' is program for you')
c) ('My ', ' is program for you')
d) ('My ', ' is ', ' for you')
15. Rekha wants to transfer pictures from her mobile phone to her laptop. She uses 1
Bluetooth Technology to connect two devices. Which type of network will be
formed in this case?
a) PAN b) LAN c) MAN d) WAN
16. Fill in the blank: 1
The technique by which nodes of a network transmit data to other nodes, is
known as ______ technique.

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()

23. Write two points of difference between HTTP and FTP. 2


(OR)
State the advantages and disadvantages of star topology over bus topology?
24. What does the following python program display? 2
str1=list("Xy82")
for i in range(len(str1)):
if i==3:
x=int(i)
x+=x-3
str1[i]=x
elif (str1[i].islower()):
str1[i]=str1[i].upper()
else:
str1[i]=str1[i]*2
print(str1)
OR
Predict the output for the following:
A=[1,2,3]
B=[5,6,7]
for i in range(1,3):
A[i-1]=A[i]+1
for i in range(0,3):
print(A[i],end='-')
print()
for i in range(1,3):
B[i-1] =B[i]+1
for i in range(0,3):
print(B[i],end='#')
print()
25. Find the output for the following code: 2
(a)
def display (num) :
num.append ([27])
return (num[1], num[2], num[3])
list1= [6, 12, 27]
n1, n2, n3 = display (list1)
print (list1)
(b)
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)
SECTION- C
26. Predict the output: 3
def changer(p, q=10):
p=p/q
q=p%q
print(p,'#',q)
return p
a=200
b=20
a=changer(a,b)
print(a,'$',b)
a=changer(a)
print(a,'$',b)
27. a) What will be the output of the following Python code? 2+1
d1={'a':10, 'b':2, 'c':3}
str1= ' '
for i in d1:
str1=str1+str(d1[i])+ ' '
str2=str1[ : -1]
print(str2[: : -1])

b)What is following code doing? What would it print for input as 3?


n = int (input("Enter an integer : "))
if n < 1 :
print ("invalid value")
else :
for i in range (1, n + 1) :
print (i * i)
28. Write a function in Python to count the number of lines in a text file 3
‘STORY.TXT’ which is starting with an alphabet ‘A’.
OR
Write a function, vowel() in Python that counts and displays the number of
vowels in the text file named sample.txt.
29. i)Predict the output of the code given below: 1+2
s = 'MoHaNdAs GaNdHi'
i=0
while i<len(s):
if (s[i].islower()):
print(s[i].upper(),end=' ')
if (s[i].isupper()):
print(s[i].lower(),end=' ')
i += 1

ii) A stack Book contains the following details of various books –


[book_no, book_title, book_price]. Write a function PushBook(Book)in
Python that inputs the book details from the user and pushes into the stack.
Also, display the stack elements.
30. Jiya has a list containing 8 integers. You need to help her create a program with 3
two user defined functions to perform the following operations based on this list.
• Traverse the content of the list and push those numbers into a stack which are
divisible by both 5 and 3.
• Pop and display the content of the stack.
For example: If the sample Content of the list is as follows:
L=[5,15,21,30,45,50,60,75]
Sample Output of the code should be: 75 60 45 30 15
SECTION-D
31. i) Predict the output of the following Python code: 2+2
def Bigger(N1,N2):
if N1>N2:
return N1
else:
return N2
L=[32,10,21,54,43]
for c in range (4,0,-1):
a=L[c]
b=L[c-1]
print(Bigger(a,b),'@', end=' ')

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)

Suggest the most appropriate block/location to house the SERVER in the


JAIPUR office (out of the 3blocks) to get the best and effective connectivity.
Justify your answer.
(ii) Suggest the best wired medium and draw the cable layout (Block to Block) to
efficiently connect various blocks within the JAIPUR office compound.
(iii) Suggest a device/software and its placement that would provide data security
for the entire network of the JAIPUR office.
(iv) Suggest a device and the protocol that shall be needed to provide wireless
Internet access to all smartphone/laptop users in the JAIPUR office.
34. i)What is the role of newline argument in opening of CSV files ? 5
ii)Write a Program in Python that defines and calls the following user defined
functions:
a) ADD() – To accept and add data of a book to a CSV file
‘book.csv’. Each record consists of a list with field elements as
bookid, title and price to store book id, book title and
book price respectively.
b) COUNTR() – To count the number of records present in the CSV file
named ‘book.csv’.
OR
i)What is pickle module? Why we use pickle module?
ii)A binary file “STUDENT.DAT” has structure [admission_number, Name,
Percentage]. Write a function countrec() in Python that would read contents of
the file “STUDENT.DAT” and display the details of those students whose
percentage is above 75. Also display number of students scoring above 75%.
35. Arun, during Practical Examination of Computer Science, has been assigned an 5
task to write a search() function to search in a pickled file student.dat. The
Filestudent.dat is created by his teacher and the following information is known
about the file.
• File contains details of students in [roll_no,name,marks] format.
• File contains details of 10 students (i.e. from roll_no 1 to 10) and separate list of
each student is written in the binary file using dump().
Help him to write the code and print details of roll number 1.

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.

Content of the file is:


‘‘India is the fastest growing economy. India is looking for more investments
around the globe. The whole world is looking at India as a great market. Most of
the Indians can foresee the heights that India is capable of reaching.’’

Output of the file: {‘India’: 4, ‘is’: 4, ‘the’: 4, ‘fastest’: 1, ‘growing’: 1,


‘economy.’: 1, ‘looking’: 2, ‘for’: 1, ‘more’: 1, ‘investments’: 1, ‘around’: 1,
‘globe.’: 1, ‘The’: 1, ‘whole’: 1, ‘world’: 1, ‘at’: 1, ‘as’: 1, ‘a’: 1, ‘great’: 1,
‘market.’: 1, ‘Most’: 1, ‘of’: 2, ‘Indians’: 1, ‘can’: 1, ‘foresee’: 1, ‘heights’: 1,
‘that’: 1, ‘capable’: 1, ‘reaching.’: 1}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy