0% found this document useful (0 votes)
20 views6 pages

Practise Paper 1 (For TERM 1)

Uploaded by

hanas
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)
20 views6 pages

Practise Paper 1 (For TERM 1)

Uploaded by

hanas
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/ 6

VELAMMAL VIDHYASHRAM PADUR

PRACTISE PAPER-1 (for TERM-1 EXAM)


COMPUTER SCIENCE (083)

Class : 12 Maximum Marks : 44


Date : Time : 2 hours

General Instructions:
(i) This question paper contains 26 questions.
(ii) All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
(iii) The paper is divided into 5 Sections- A, B, C, D and E.
(iv) Section A consists of 16 questions (1 to 16). Each question carries 1 Mark.
(v) Section B consists of 5 questions (17 to 21). Each question carries 2 Marks.
(vi) Section C consists of 3 questions (22 to 24). Each question carries 3 Marks.
(vii) Section D consists of 1 question (25) which carries 4 Marks.
(viii) Section E consists of 1 question (26) which carries 5 Marks.
(ix) All programming questions are to be answered using Python Language only.
(x) In case of MCQ, text of the correct answer should also be written.

SECTION - A 16x1=16

1. State True or False : 1


“In Python, complex is a mutable data type”.

2. Fill in the blank : 1


The full form of DDL is _________________

3. What will be the output of the following statement ? 1


print(10+5/4**2//5+8)
(a) -18.0 (b) 18.0 (c) 18 (d) -18

4. Select the correct output of the code : 1


STR = "luck#thrill"
print(STR.strip("l"))

(a) uck#thrill (b) uck#thril (c) uck#thri (d) luck#thril

5. Identify the valid Python identifier from the following : 1


(a) 2user (b) user@2 (c) user_2 (d) user 2

6. Consider the statements given below and then choose the correct output 1
from the given options :
Game="World Cup 2023"
print(Game[-6::-1])

(a) CdrW (b) ce o (c) puC dlroW (d)Error

Page 1 of 6
7. State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically correct.

8. Which of the following output will never be obtained when the given code is 1
executed ?
import random
Shuffle = random.randrange(10)+1
Draw = 10*random.randrange(5)
print ("Shuffle", Shuffle, end="#")
print ("Draw", Draw)

(a) Shuffle 1 # Draw 0


(b) Shuffle 10 # Draw 10
(c) Shuffle 10 # Draw 0
(d) Shuffle 11 # Draw 50

9. What will be the output of the given code ? 1


a=40
def convert(b=50):
a=60
c=a+b
print(a,c)
convert(60)
print(a)

10. __________ files are stored in a computer in a sequence of bytes. 1


(a) Text (b) Binary (c) CSV (d) Notepad

11. For the following Python statement : 1


N = (25)
What shall be the type of N ?
(a) Integer (b) String (c) Tuple (d) List

12. State True or False: 1


A try block in Python must always be followed by an except block.

13. Predict the output of the following Python statements : 1


>>>import statistics as s
>>>s.mode ([10, 20, 10, 30, 10, 20, 30])
(a) 30 (b) 20 (c) 10 (d) 18.57

14. State whether the following statement is True or False: 1


The finally block in Python is executed only if no exception occurs in the try block.

The following questions 15 and 16 are Assertion-Reasoning based, answer the


questions by choosing one of the following responses:
(a) Both A and R are true and R is the correct explanation of A.

Page 2 of 6
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.

15. Assertion (A) : Global variables are accessible in the whole program. 1
Reason (R) : Local variables are accessible only within a function or block
in which it is declared.

16. Assertion (A) : If numeric data are to be written to a text file, the data needs to be 1
converted into a string before writing to the file.
Reason (R) : write() method takes a string as an argument and writes it to the text
file.

SECTION - B 5x2=10

17. Observe the following code carefully and rewrite it after removing all syntactical 2
errors. Underline all the corrections made.
def 1func():
a=input("Enter a number"))
if a>=33
print("Promoted to next class")
ELSE:
print("Repeat")

18. Predict the output of the following code : 2


d={"IND":"DEL","SRI:"COL","CHI":"BEI"}
str1=""
for i in d:
str1=strl+str(d[i])+"@"
str2=str1[:–1]
print (str2)

19. (a) Write the Python statement for each of the following tasks using BUILT-IN 2
functions/methods only :
(i) To delete an element 40 from the list L.
(ii) To replace the string "these" with "those" in the string st.
OR
(b) A dictionary d2 is copied into the dictionary d1 such that the common key’s
value gets updated. Write the Python commands to do the task and after that
empty the dictionary d1. 2

Page 3 of 6
20. Predict the output of the following code : 2
def Aggr (adj=10):
Tot=0
for C in range(1,adj+1):
if C%2!=0:
continue
Tot+=C
return Tot
print(Aggr(4),end="$")
print(Aggr(),sep="@")

21. Find the output of the following: 2


STUD={1001: [‘Abubakkar’, ‘MBBS’], 1018: [‘Veena’, ‘BDS’]}
L=[ ]
for i in STUD.keys():
L.append(i)
m, n=max(L),min(L)
print(STUD.setdefault(m+1), STUD.setdefault(n+2))
print(STUD.items())

SECTION - C 3x3=9

22. (a) Predict the output of the Python code given below : 3
s="India Growing"
n = len(s)
m=""
for i in range (0, n) :
if (s[i] >= 'a' and s[i] <= 'm') :
m = m + s [i].upper()
elif (s[i] >= 'O' and s[i] <= 'z') :
m = m +s [i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m + '@'
print (m)

OR

Page 4 of 6
(b) Find the output of the following Python code :
j=12
c=9
while (j):
if j>5:
c=c+j-2
j=j-1
else:
break
print(j,c)
print (c)

23. (a) Write a method/function COUNTWORDS() in Python to read contents from a 3


text file ENCODE.TXT, to count and return the occurrence of those words,
which are having 4 or more characters.
OR
(b) Write a method/function COUNTLINES() in Python to read lines from a text file 3
PARA.TXT, and display those lines, which have @ anywhere in the line.

24. Predict the output of the following Python code: 3


for i in range(5, 0, -1):
for j in range(1, i+1):
if (j%2==0):
print("0", end=" ")
else:
print("1", end=" ")
print()

SECTION - D 1x4=4

25. Mr. Varun is a Python Programmer working in a school. He has to maintain the 4
records of the sports students. He has created a csv file named sports.csv, to store the
details. The structure of sports.csv is : [sport_id, competition, prize_won]
where
sport_id, is Sport id (integer)
competition is competition name (string)
prize_won is (“Gold”, “Silver”, “Bronze”)

Mr. Mahesh wants to write the following user-defined functions :


Add_detail(): to accept the detail of a student and add to a csv file, "sports.csv".
Count_Medal(): to display the name of competitions in which students have won
"Gold" medal.
Help him in writing the code of both the functions.

SECTION - E 1x5=5

Page 5 of 6
26. Ram is a programmer working in an IT company. He needs to manage the records of 5
various items. For this, he wants the following information of each item to be stored:
Itemcode – integer
Description – string
Quantity - float
Price– float
You, as a programmer help Ram to complete the following tasks assigned:
(i) Write a function to input the data of an item and append it in the binary file
“STOCK.dat”.
(ii) Write a function to decrease the Price of items by 10% whose quantity is more
than 50 in the binary file..
(iii) Write a function to read data from the binary file and display the data of all
those items whose quantity is below 20.

Page 6 of 6

You might also like