0% found this document useful (0 votes)
2 views

oldpapers

The document is a pre-annual examination paper for Computer Science for Std XI at SNDJA Vivekananda Vidyalaya, Chennai, containing 37 questions divided into 5 sections. Each section has varying marks assigned, with programming questions specifically requiring answers in Python. The paper includes multiple-choice questions, programming tasks, and theoretical questions covering various computer science concepts.

Uploaded by

aashish712009
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)
2 views

oldpapers

The document is a pre-annual examination paper for Computer Science for Std XI at SNDJA Vivekananda Vidyalaya, Chennai, containing 37 questions divided into 5 sections. Each section has varying marks assigned, with programming questions specifically requiring answers in Python. The paper includes multiple-choice questions, programming tasks, and theoretical questions covering various computer science concepts.

Uploaded by

aashish712009
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/ 158



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39


Std :XI PRE-ANNUAL EXAMINATION – 2024-25 Time : 3 Hrs
Subject : Computer Science SET - 1 Max. Marks:70
General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.

SECTION A (21 x 1 =21)


1. is the part of the CPU that performs the arithmetic operations.
A) ALU B) CU C) Memory D) None
2. A nibble in computer memory is a group of .
A) 8 bits B) 8 bytes C) 4 bits D) 4 bytes
Which of the following does not store data permanently?
3.
(i) Hard Disk (ii) Floppy disk (iii) RAM (iv) ROM
4. Which of the following is not an operating system?
a) Windows b) Linux c) Oracle d) DOS
5. Keys of the dictionary must be :
(A) Similar (B) Unique (C) Can be similar or unique (D) All of these
6. Which of the following fall under utilities software?
(i)Text editor (ii) backup (iii) Disk defragmenter (iv) All of the above
7. Is python a case sensitive language? A) True B) False
8. Which of the following can be used as valid variable identifiers in Python?
i) 4th Sum ii) Total iii) Number# iv) _Data

9. To increase the value of k five times using an assignment operator, the correct
expression will be :
k += 5 B) k *=5 C) k = k**5 D) k =*5
10. What is the value of x ?
x = int (13.25 +4/2)
a) 17 b) 14 c) 15 d) 23
11. What will be the output of the following code:-
x = 73
y = x%9
print(y)
12. The statement forms the selection construct in Python.
A) for B) while C) if D) None
13. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3]) b) t[3] = 45 c) print(max(t)) d) print(len(t))

1
14. Identify the type of error
a=10 , b=0
c=a/b
i) Semantics Error ii) Syntax Error iii) Run Time error iv )No Error
15. A loop becomes an infinite loop if a condition never becomes true.
a. True b. False
16. What is the output of following code :
L = [ 5, 8]
print (L * 3)
a) Syntax error b) [5,8,5,8,5,8] c) [15,24] d) [8,11]
17 Which of the following will delete key-value pair for key = “Red” from a
dictionary D1?
a. delete D1("Red") b. del D1["Red"] c. del.D1["Red"] d. D1.del["Red"]
18 Which of the following is a function of the math Module?
a. random() b) mean() c) floor() d) median()
19 Which of the following outputs is the correct option for the code shown here ?
STR='TEXT CONTENT'
print(STR.strip('T'))
a. EX CONEN b) EX CONTEN c) EXT CONTEN d) TEXT CONTEN
Q20 and Q21 are Assertion(A) and Reason(R) 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
20 Assertion(A): List is an immutable data type
Reasoning(R): When an attempt is made to update the value of an immutable variable,
the old variable is destroyed and a new variable is created by the same name in
memory.
21 Assertion (A):- The expression sorted('TEXT')in Python will give Error.
Reasoning (R):- String is an immutable type in Python.

SECTION – B (7 X 2 =14)

22 Rewrite the following code after removing all the syntax errors with each of the
corrections underlined:
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else
print("Number is prime \n’)
23 Write the results of the following:
a. print(6 * 15 - 2 // 7 - 2 * 3)
b. print(12 * 3 + 43 - 2 + 5 % 2)
24 Draw a logic circuit equivalent for the following Boolean Expression:
A’ + B’ + C’
OR

2
Draw a logic circuit equivalent for the following Boolean Expression:
(A’.B’)+ C’
25 Write the output of the Python code given below:
wD=('SUN','MON','TUE','WED','THU','FRI','SAT')
L=D[1:len(D)-1]
print('#'.join(L))
OR
Write the output of the Python code given below:
D={'Grapes':50,'Mango':70,'Banana':20}
print(sorted(D))
26 Give two examples of each of the following:
(I) Arithmetic operators (II) Relational operators
27 Expand the following : a) ASCII b) ZB
28 Differentiate between mutable and immutable data type.

SECTION – C (3 X 3 =9
29 Write a program to check whether an integer number input by a user is prime or not?
OR
Write a program to input an integer value and display it in reverse order
30 What do you mean by data types? Explain different datatypes available in python with
examples.
Or
What are comments? What is the use of comments in programming?
31 Consider the following code segment for the questions A to E:
a=int(input("enter an integer"))
b=int(input("enter an integer"))
if a<=0:
b=b+1
else:
a=a+1
if a>0 and b>0:
print("W")
elif a>0:
print("X")
if b>0:
print("Y")
else:
print("Z")
A. What letters will be printed if the user enters 0 for a and 0 for b?
a. Only W b). Only X c). Only Y d) W and X e) W,X and Y

3
B. What letters will be printed if the user enters 1 for a and 1 for b?
a. W and X b). W and Y c). X and Y d). X and Z e). W,X and Y
C. What letters will be printed if the user enters 1 for a and -1 for b?
a. W and X b). X and Y c). Y and Z d). X and Z e). W and Z
D. What letters will be printed if the user enters 1 for a and 0 for b?
a. W and X b). X and Y c). Y and Z d). X andZ e). W and Z
E. What letters will be printed if the user enters -1 for a and -1 for b?
a. Only W b) Only X c) Only Y d) Only Z e) No letters are printed
F. What letters will be printed if the user enters 0 for a and 1 for b?
a. Only W b) Only X c) Only Y d) Only Z e) No letters are printed
SECTION – D (4 X 4 = 16)
32
Write single line Python commands to perform each of the following operations:
QUOTE="Life is beautiful"
● Display the length of the string QUOTE.
● Display the reverse of the string QUOTE.
● Display the count of 'i' from the string QUOTE
● Display the substring 'beauti'from the string QUOTE.
Or
Write a python code to accept values of X as float and N as int, find and display the
sum of following series:
(a) 1 + 4 + 7 + ... upto N
1/X1 + 1/X2+ 1/X3... upto Nth Terms
33 Write a Python code to accept a number and display its factors. The process should
continue till the user wants.
For Example
Enter N: 10
Factors: 1,2,5,10
34 Give 2 example for each of the following :
a) Hardware b) Software c) output devices d) input devices
35 List the function of operating system and explain.

SECTION – E (2X5=10)
36 Convert the following from one number system to another ( show the complete working )
:
a. (512)10 =( )2
b. (10010111)2 =( )10
c. (451)8 =( )16
d. (111001101)2 = ( )8
e. (175)10= ( )8
37 Explain the following dictionary functions with example :
 setdefault()
 fromkeys()
 keys()

4
5

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39
Std :XI PRE-ANNUAL EXAMINATION – 2024-25 Time : 3 Hrs
Subject : Computer Science SET - 2 Max. Marks:70
General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.

SECTION A (21 x 1 =21)


1. Keys of the dictionary must be :
(A) Similar (B) Unique (C) Can be similar or unique (D) All of these
2. A nibble in computer memory is a group of .
A) 8 bits B) 8 bytes C) 4 bits D) 4 bytes
Which of the following does not store data permanently?
3.
(i) Hard Disk (ii) Floppy disk (iii) RAM (iv) ROM
4. Which of the following is not an operating system?
a) Windows b) Linux c) Oracle d) DOS
5. is the part of the CPU that performs the arithmetic operations.
A) ALU B) CU C) Memory D) None
6. Which of the following fall under utilities software?
(i)Text editor (ii) backup (iii) Disk defragmenter (iv) All of the above
7. Is python a case sensitive language?
A) True B) False
8. Which of the following can be used as valid variable identifiers in Python?
i) 4th Sum ii) Total iii) Number# iv) _Data

9. To increase the value of k five times using an assignment operator, the correct
expression will be :
k += 5 B) k *=5 C) k = k**5 D) k =*5
10. What is the value of
x ? x = int (13.25
+4/2)
a) 17 b) 14 c) 15 d) 23
11. A loop becomes an infinite loop if a condition never becomes true.
a. True b. False
12. The statement forms the selection construct in Python.
A) for B) while C) if D) None
13. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3]) b) t[3] = 45 c) print(max(t)) d) print(len(t))

6
14. Identify the type of error
a=10 , b=0
c=a/b
i) Semantics Error ii) Syntax Error
iii) Run Time error iv )No Error
15. What will be the output of the following code:-
x = 73
y = x%9
print(y)
16. What is the output of following code :
L = [ 5, 8]
print (L * 3)
b) Syntax error b) [5,8,5,8,5,8] c) [15,24] d) [8,11]
17 Which of the following will delete key-value pair for key = “Red” from a
dictionary D1?
a. delete D1("Red") b. del D1["Red"] c. del.D1["Red"] d. D1.del["Red"]
18 Which of the following is a function of the math Module?
b. random() b) mean() c) floor() d) median()
19 Which of the following outputs is the correct option for the code shown here ?
STR='TEXT CONTENT'
print(STR.strip('T'))
b. EX CONEN b) EX CONTEN c) EXT CONTEN d) TEXT CONTEN
Q20 and Q21 are Assertion(A) and Reason(R) 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
20 Assertion(A): List is an immutable data type
Reasoning(R): When an attempt is made to update the value of an immutable
variable, the old variable is destroyed and a new variable is created by the same
name in memory.
21 Assertion (A):- The expression sorted('TEXT')in Python will give Error.
Reasoning (R):- String is an immutable type in Python.
SECTION – B (7 X 2 =14)
22 Rewrite the following code after removing all the syntax errors with each of the
corrections underlined:
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else
print("Number is prime \n’)
23 Write the results of the following:
a) print(6 * 15 - 2 // 7 - 2 * 3) b) print(12 * 3 + 43 - 2 + 5 % 2)
24 Draw a logic circuit equivalent for the following Boolean Expression: A’ + B’ + C’

7
OR
Draw a logic circuit equivalent for the following Boolean Expression: (A’.B’)+ C’
25 Write the output of the Python code given below:
D=('SUN','MON','TUE','WED','THU','FRI','SAT') L=D[1:len(D)-1]
print('#'.join(L))
OR
Write the output of the Python code given below:
D={'Grapes':50,'Mango':70,'Banana':20}
print(sorted(D))
26 Give two examples of each of the following:
(I) Arithmetic operators (II) Relational operators
27 Expand the following : a) ASCII b) ZB
28 Differentiate between mutable and immutable data type.
SECTION – C (3 X 3 =9
29 Write a program to check whether an integer number input by a user is prime or not?
OR
Write a program to input an integer value and display it in reverse order
30 What do you mean by data types? Explain different datatypes available in python
with examples.
Or
What are comments? What is the use of comments in programming?
31 Consider the following code segment for the questions A to E:
a=int(input("enter an integer"))
b=int(input("enter an integer"))
if a<=0:
b=b+1
else:
a=a+1
if a>0 and b>0:
print("W")
elif a>0:
print("X")
if b>0:
print("Y")
else:
print("Z")
A. What letters will be printed if the user enters 0 for a and 0 for b?
a. Only W b). Only X c). Only Y d) W and X e) W,X and Y
B. What letters will be printed if the user enters 1 for a and 1 for b?
a. W and X b). W and Y c). X and Y d). X and Z e). W,X and Y

8
C. What letters will be printed if the user enters 1 for a and -1 for b?
a. W and X b). X and Y c). Y and Z d). X and Z e). W and Z
D. What letters will be printed if the user enters 1 for a and 0 for b?
a. W and X b). X and Y c). Y and Z d). X andZ e). W and Z
E. What letters will be printed if the user enters -1 for a and -1 for b?
a. Only W b) Only X c) Only Y d) Only Z e) No letters are printed
F. What letters will be printed if the user enters 0 for a and 1 for b?
a. Only W b) Only X c) Only Y d) Only Z e) No letters are printed
SECTION – D (4 X 4 = 16)
32
Write single line Python commands to perform each of the following operations:
QUOTE="Life is beautiful"
● Display the length of the string QUOTE.
● Display the reverse of the string QUOTE.
● Display the count of 'i'from the string QUOTE
● Display the substring 'beauti'from the string QUOTE.
Or
Write a python code to accept values of X as float and N as int, find and display the
sum of following series:
(a) 1 + 4 + 7 + ... upto N
(b) 1/X1 + 1/X2+ 1/X3... upto Nth Terms
33
Write a Python code to
● Input 10 integers into a list NUM.
● Display all the multiple of 5 from the list NUM
● Display the highest and lowest integer from the list NUM
● Display the list NUM in the ascending order.
34 Define the following terms:
a) Application Software b) Compiler c) Interpreter d) System Utilities
35 State and prove Demorgan’s law using Truth table.
SECTION – E (2X5=10)
36 Convert the following from one number system to another ( show the complete
working ) :
a. (512)10 =( )2
b. (10010111)2 =( )10
c. (451)8 =( )16
d. (111001101)2 = ( )8
e. (175)10= ( )8
37 Explain the following dictionary functions with example :
 get()
 popitem()
 update()

9

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39
Std :XI II MID TERM – 2024-25 Time : 3 Hrs
Subject : Computer Science SET - 1 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
1. All questions are compulsory.
2. Section A have 18 questions carrying 01 mark each.
3. Section B has 07 Very Short Answer type questions carrying 02 marks each.
4. Section C has 05 Short Answer type questions carrying 03 marks each.
5. Section D has 02 Long Answer type questions carrying 04 marks each.
6. Section E has 03 Very Long Answer type questions carrying 05 marks each.
Q No. Questions Section-A (18 Marks) Marks
1 Which symbol is used to represent processing in flowcharts. 1
a) circle b) rectangle c) diamond d) parallelogram
2 Which of the following is not a token 1
a) keyword b) identifier c) expression d) operator
3 What will be the output of the following statement: 1
print(4+2**3**2-5//11%3)
a) 66 b) 46 c) 516 d) 494
4 What is the output of the following code 1
print(str([1,2,3]))
a) ‘123’ b) ‘1,2,3’ c) ‘[1,2,3]’ d) error
5 State True or False: 1
“In a Python program if break statement is executed in a loop then loop’s
else block will be executed or not”.
6 Which gate produces 1 when all inputs are 1. 1
a) NAND b) NOT c) AND d) OR
7 Which of the following expression will result in an error 1
a) ‘3’ * 3 b) (3) * 3 c) [3] * 3 d) ‘3’+7
8 Which of the following is / are tuple? 1
a) 3,5 b) (10) c) (15,16) d) [1,2, (3,4)]
9 Which of the following statement(s) would give an error during execution 1
of the
following code?
s = ‘Python supremacy’
print(s) #Statement 1
print(s[0]+ ‘O’ ) #Statement 2
s[0] = ‘p’ #Statement 3
print(max(s)) #Statement 4
a) Statement 1 b) Statement 2 c) Statement 3 d) Statement 4

10
10 Which one of the following in correct ascending order of size for nibble, 1
byte, kb, bit, mb
a) bit<byte<nibble<mb<kb b) nibble<byte<bit<kb<mb
c) bit<byte<nibble<kb<mb d) bit<nibble<byte<kb<mb
11 ____________________is a system software that translates and executes 1
instructions
written in a computer program line-by-line.
a) Assembler b) Interpreter c) Compiler d) None of these
12 Which encoding scheme has code points for all the known languages 1
a) ASCII b) Unicode c) ISCII d) none of these
13 The hexadecimal digits are 1 to 0 and A to ________________
a) E b). F c). G d). D
14 Which of the following is an escape sequence for a new line character?
a) \a b). \t c) \n d) \b
15 Mr Somil assigned the values to python variable, What will the following
code produce?
A , B = 8.6
print(A//B)
a)4.3 b). 4.0 c). 4 d) Compilation error
16 Which of the following will return the last element of a list L with 5
elements?
a. L[5] b) L[-4] c) L[-1] d) L[6]
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 if 7:
print(“True”)
else:
print(“False”)
Assertion (A): Output of the above code is False
Reasoning (R): Non-empty and Non-Zero object is treated as True.
18 d={1,11,[2,22], 3,33]
print(2 in d)
Assertion (A): Output of above code is False.
Reasoning (R): Membership operator does not check for values in the
nested sequence.
Q No. Questions Section-B (14 Marks) Marks
19 What is the difference between RAM and ROM? 2
Or
Name the input or output device to do the following :
a. To output audio b. To enter textual data c. To make hard copy of a

11
text file.
d. To display the data or information

20 Write a program to input two numbers and swap them. 2


Or
Write a program to input a number and print its cube and also print
original number.
21 What does each of the following expressions evaluates to? Suppose that 2
L is the list
[“These”, [“are”, “a”], [“few”, “words”], “that”, “we”, “will”, “use”]
a. len( L )
b. L[3 : 4] + L[1 : 2]
or
a)What is the output produced when this code executes?
A=0
for I in range (4, 8):
if I % 2 = = 0:
A=A+I
print (A)
b)How many times does the following code execute?
X=1
while ( X < = 5):
X+1
print(X)
22 Draw logic circuit for following Boolean expressions: 2
(i) AB’ + B(A+C)
(ii) (AB+BC)(AC)
23 Correct and rewrite the following code underlining all the corrections. 2
x=int(input(“Enter speed”)
if x>120
print(“Vehicle impounded”)
else x=>80:
print(“Fine 2000 Rs.)
else:
print(“Good to go”)
OR
Write output of the following code:
x=1531
s=0
while x>0:
a=x%10
s=s+a
x=x//10
print(s)

12
24 If value = (5,4,3,2,1,0) evaluate the following expressions: 2
print(value[0])
print (value[value[0]])
print(value[value[-2]])
print(value[value[value[value[2]+1]]])
25 Write logical expression for the following: 2
1) Name is riya and age is between 10 and 15
2) CITY is either ‘Delhi’ or ‘Mumbai’ but not ‘Kolkata’

Q No Questions Section-C (15 Marks) Marks


26 Write a program to generate the following series using loop structure to 3
generate upto n terms.
123 A
12 or AB
1 ABC
27 Write a Python program to calculate bonus as the following criteria using 3
if- elif statement :
If salary between bonus
Salary - 0 to 25000 Bonus - 25% of salary
Salary - 25001 to 35000 Bonus - 15% of salary
Salary - 35001 to 50000 Bonus - 10% of salary
Salary - 50001 to 75000 Bonus - 05 % of salary
Salary - 75001 and above Bonus - nil
28 Find the output of the following code: 3
>>> L=["These", "are", "a", ["few", "words"], "that", "we", "will", "use"]
>>> print (L[3:4])
>>> print (L[1:4:-1])
>>> print ("few" in L)
>>> print (L[0::2])
>>> print (L[4:])
>>> print (L)
29 State De Morgan’s laws / theorems and prove using truth table. 3
30 What is indexing and which data type supports indexing explain with 3
example.
Q No. Questions Section-D (8 Marks) Marks
31 Convert the following number system. 4
(a) (11011.10 )2 into ()10
(b)(11100.1010)2 in to ()16
(c) (10AF)16 into ()2
(d)(A42)16 into ()8

13
32 Write a program to input names of n students and store them in a tuple. 4
Also, input a name from the user and find if this student is present in the
tuple or not.
Q No. Questions Section-E (15 Marks) Marks
33 Explain any 5 string functions with example 5

34 Explain any 5 list functions with example 5

35 What is meant by slicing ? Explain the various parameters for slicing? 5


What are the default values of the parameters?

14

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39
Std :XI II MID TERM – 2024-25 Time : 3 Hrs
Subject : Computer Science SET - 2 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
1. All questions are compulsory.
2. Section A have 18 questions carrying 01 mark each.
3. Section B has 07 Very Short Answer type questions carrying 02 marks each.
4. Section C has 05 Short Answer type questions carrying 03 marks each.
5. Section D has 02 Long Answer type questions carrying 04 marks each.
6. Section E has 03 Very Long Answer type questions carrying 05 marks each.
Q No. Questions Section-A (18 Marks) Marks
1 Which of the following will create a single element tuple? 1
a. (1,) b) (1) c) ([1]) d) None of these
2 Dictionaries are also called_____ 1
a. Mappings b) Hashes c) Associative arrays d) All of these
3 Ms. Asha develop program of application of operator but she was 1
confused amongst the operator available, Suggest her Which of the
following is/are not legal string operators?
a)in b) + c) * d) /
4 An input function always returns a value of ___________ type. 1
5 A variable can contain values of different types at different times. 1
(True/False)
6 What will be the value of y after following code fragment is executed? 1
x=10.0
y=(x<100.0) and x>=10
(a)110 (b)True (c)False (d)Error
7 Which loop is appropriate to use when the number of iterations is 1
known?
A. for loop B. while loop C. do-while loop D. break loop
8 How can you check if a string contains only alphabets? 1
a) isalpha() b) isalphabet() c) isletters() d) isalphabets()
9 What is the output of the following code? 1
y = (3)
print(type(y))
a) <class ‘int’> b) <class ‘tuple’> c) <class ‘list’> d) <class str>
10 The Physical components of computer are called 1
a. Hardware b. Software c. Firmware d. CPU

15
11 Consider the given expression: not True and False or True 1
Which of the following will be correct output if the given expression is
evaluated?
(a) True (b) False (c) NONE (d) NULL
12 Identify the valid relational operator(s) in Python from the following : 1
(A) = (B) < (C) <> (D) not
13 What will the following expression be evaluated to in Python?
print(15.0 / 4 + (8 + 3.0))
(a) 14.75 (b)14.0 (c) 15 (d) 15.5
14 Which of the following is an invalid statement?
a) a=b=c=2 b) a,b,c=10,20,30 c) a b c=20,30,40 d) a_b_c=20
15 What is the output of the following code?
str1= “Mission 999”
str2= “999”
print(str1.isdigit(), str2.isdigit())
a. False True b. False False c. True False d. True True
16 Which symbol is used to represent input/output in flowcharts.
a) circle b) rectangle c) diamond d) parallelogram
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): Strings in Python are mutable.
Reason (R): The first character has the index 0 and the last character has
the index n-1 where n is the length of the string.
18 Assertion: The ‘for’ loop is a counting loop that works with sequences of
values.
Reason: The range() function generates a sequence of list type
Q No. Questions Section-B (14 Marks) Marks
19 What is the difference between RAM and ROM? 2
Or
Name the input or output device to do the following :
a. To output audio
b. To enter textual data
c. To make hard copy of a text file.
d. To display the data or information
20 Write a program to input two numbers and swap them. 2
Or
Write a program to input a number and print its cube and also print
original number.

16
21 What does each of the following expressions evaluates to? Suppose that 2
L is the list
[“These”, [“are”, “a”], [“few”, “words”], “that”, “we”, “will”, “use”]
a. len( L )
b. L[3 : 4] + L[1 : 2]
or
a)What is the output produced when this code executes?
A=0
for I in range (4, 8):
if I % 2 = = 0:
A=A+I
print (A)
b)How many times does the following code execute?
X=1
while ( X < = 5):
X+1
print(X)
22 Draw logic circuit for following Boolean expressions: 2
(i) AB’ + B(A+C)
(ii) (AB+BC)(AC)
23 Correct and rewrite the following code underlining all the corrections. 2
x=int(input(“Enter speed”)
if x>120
print(“Vehicle impounded”)
else x=>80:
print(“Fine 2000 Rs.)
else:
print(“Good to go”)
OR
Write output of the following code:
x=1531
s=0
while x>0:
a=x%10
s=s+a
x=x//10
print(s)
24 If value = (5,4,3,2,1,0) evaluate the following expressions: 2
print(value[0])
print (value[value[0]])
print(value[value[-2]])
print(value[value[value[value[2]+1]]])
25 Write logical expression for the following: 2
1) Name is riya and age is between 10 and 15
2) CITY is either ‘Delhi’ or ‘Mumbai’ but not ‘Kolkata’

17
Q No Questions Section-C (15 Marks) Marks
26 Write a program to generate the following series using loop structure to 3
generate upto n terms.
123 A
12 or AB
1 ABC
27 Write a Python program to calculate bonus as the following criteria using 3
if- elif statement :
If salary between bonus
Salary - 0 to 25000 Bonus - 25% of salary
Salary - 25001 to 35000 Bonus - 15% of salary
Salary - 35001 to 50000 Bonus - 10% of salary
Salary - 50001 to 75000 Bonus - 05 % of salary
Salary - 75001 and above Bonus - nil
28 Find the output of the following code: 3
>>> L=["These", "are", "a", ["few", "words"], "that", "we", "will", "use"]
>>> print (L[3:4])
>>> print (L[1:4:-1])
>>> print ("few" in L)
>>> print (L[0::2])
>>> print (L[4:])
>>> print (L)
29 State De Morgan’s laws / theorems and prove using truth table. 3
30 What is indexing and which data type supports indexing explain with 3
example.
Q No. Questions Section-D (8 Marks) Marks
31 Convert the following number system. 4
(a) (11011.10 )2 into ()10
(b)(11100.1010)2 in to ()16
(c) (10AF)16 into ()2
(d)(A42)16 into ()8
32 Write a program to input names of n students and store them in a tuple. 4
Also, input a name from the user and find if this student is present in the
tuple or not.
Q No. Questions Section-E (15 Marks) Marks
33 Explain any 5 string functions with example 5

34 Explain any 5 list functions with example 5

35 What is meant by slicing ? Explain the various parameters for slicing? 5


What are the default values of the parameters?

18
19


 

20

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39
Std :XII II MID TERM – 2024-25 Time : 3 Hrs
Subject : Computer Science SET - 1 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
1. All questions are compulsory.
2. Section A have 18 questions carrying 01 mark each.
3. Section B has 07 Very Short Answer type questions carrying 02 marks each.
4. Section C has 05 Short Answer type questions carrying 03 marks each.
5. Section D has 02 Long Answer type questions carrying 04 marks each.
6. Section E has 03 Very Long Answer type questions carrying 05 marks each.
Q No. Questions Section-A (18 Marks) Marks
1 Which of the following is an invalid identifier to be used in Python? 1
a. per%marks b) _for c) While d) true
2 What is the correct way to add an element to the end of a list in Python? 1
a. list.add(element) b) list.append(element) c) list.insert(element)
d) list.extend(element)
3 What will be the output of 1
print("Welcome To My Blog"[2:6] + "Welcome To My Blog"[5:9])
a. Lcomme b) lcomme T c) lcomme To d) lcomme
4 Which of the following statements is false? 1
a. A try-except block can have more than one except statement
b. One block of except statement cannot handle multiple exceptions
c. The finally block is always executed
d. When 1 == "1" is executed, no exception is raised
5 Which of the following statement(s) would give an error during the 1
execution of the following code?
R = {'pno':52,'pname':'Virat', 'expert':['Badminton','Tennis']
,'score':(77,44)} print(R) #Statement 1
R['expert'][0]='Cricket' #Statement 2
R['score'][0]=50 #Statement 3
R['pno']=50 #Statement 4
a. Statement 1
b. Statement 2
c. Statement 3
d. Statement 4
6 Which pickle module method is used to write a Python object to a binary 1
file?
a. save() b) serialize() c) store() d) dump()

21
7 Given the following dictionaries 1
dict_student = {"rno" : "53", "name" : 'Rajveer
Singh'}
dict_marks = {"Accts" : 87, "English" : 65}

Which statement will append the contents of dict_marks in


dict_student?
a. dict_student + dict_marks
b. dict_student.add(dict_marks)
c. dict_student.merge(dict_marks)
d. dict_student.update(dict_marks)
8 Which of the following is not a component of the math module in 1
Python?
a. ceil() b) mean() c) fabs() d) pi
9 What will be the output of the following code? 1
L=["One , Two", "Three", "Four"]
print(len(L)/2*len(L[0]))
a. 6.5 b) 13 c) 13.5 d) 6.0
10 Expand the following terms: I) PPP II) VoIP 1
11 Which SQL operator performs pattern matching? 1
a. BETWEEN operator
b. LIKE operator
c. EXISTS operator
d. =
12 Which Python function is used for displaying only one result set from SQL 1
table in a database?
a. fetch1() b) fetchno() c) fetchall() d) fetchone()
13 Which of the following file opening mode in Python, generates an error if 1
the file does not exist?
a. a b) r c) w d) w+
14 The correct syntax of seek() is: 1
a. file_object.seek(offset [, reference_point])
b. seek(offset [, reference_point])
c. seek(offset, file_object)
d. seek.file_object(offset)
15 Which of the following statements is false? 1
a. SMTP and POP protocols are used in email communication.
b. URL of a page is not always the same as its domain name.
c. HTTPS is safer than HTTP.
d. Interlinking of collection of webpages is called Internet.

22
16 Fill in the blank: 1
_________ protocol provides access to services hosted on a remote
computer.

a. FTP b) PPP c) Telnet d) SMTP


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): For changes made to a variable defined within a function 1
to be visible outside the function, it should be declared as global.
Reasoning (R): Variables defined within a function are local to that
function by default, unless explicitly specified with the global keyword.
18 Assertion (A): A binary file in python is used to store collection objects 1
like lists and dictionaries that can be later retrieved in their original form
using pickle module.
Reasoning (A): Binary files are just like normal text files and can be read
using a text editor like Notepad.
Q No. Questions Section-B (14 Marks) Marks
19 Write two advantages and two disadvantages of circuit switching. 2
OR
Differentiate between Web server and web browser. Write the names of
any two web browsers.
20 Rewrite the following code in Python after removing all the syntax errors. 2
Underline each correction done in the code.
num1, num2 = 10, 45
While num1 % num2
== 0 num1+= 20
num2+= 30
Else:
print('hello')
21 Write a function dispBook(BOOKS) in Python, that takes a dictionary
BOOKS as an argument and displays the names in uppercase of those
books whose name starts with a consonant.

For example, Consider the following dictionary

BOOKS = {1:"Python", 2:"Internet Fundamentals ",


3:"Networking ",
4:"Oracle sets", 5:"Understanding HTML"}

23
The output should be:
PYTHON NETWORKING

21 OR 2
Write a Python Program containing a function FindWord(STRING,
SEARCH), that accepts two arguments : STRING and SEARCH, and prints
the count of occurrence of SEARCH in STRING. Write appropriate
statements to call the function.

For example, if STRING = "Learning history helps to know about history


with interest in history" and SEARCH = 'history', the function should
display
The word history occurs 3 times.
22 What will be the output of the following code? 2

L = [5,10,15,1] G =
4 def Change(X):
global G
N=len(X) for i
in range(N):
X[i] += G

Change(L)
for i in L:
print(i,end='$')
23 Write a suitable Python statement for each of the following tasks using 2
built-in functions/methods only:
i To delete an element Mumbai:50 from Dictionary D. ii To
display words in a string S in the form of a list
OR
Write a Python Program to display alternate characters of a string
my_str.
For example, if my_str = "Computer Science"
The output should be Cmue cec
24 Differentiate between % (percentage) and _(underscore) characters used 2
with the LIKE operator in SQL with appropriate examples.
OR
Differentiate between DROP and DELETE commands in SQL with
appropriate examples.

24
25 Consider the following two commands with reference to a table, named 2
Employee having a column named Department:
(a) Select count(Department) from Employee;
(b) Select count(*) from Employee;

If these two commands are producing different results, (i)


What may be the possible reason?
(ii) Which command (a) or (b) might be giving a higher value?
Q No Questions Section-C (15 Marks) Marks
26 (a) Consider the table, BOOK and MEMBER given below:

TABLE : BOOK
CODE BNAME TYPE
F101 The priest Fiction
L102 Easy Python Programming
C101 Juman Ji Thriller
F102 Untold Story Fiction
C102 War Stories Comic
Table: MEMBER
MNO MNAME CODE ISSUEDATE
M101 SNEH SINHA L102 2022-10-13
M103 SARTHAK F102 2021-02-23
M102 SARA KHAN C101 2022-06-12
What will be the output of the following statement?
SELECT * FROM BOOK NATURAL JOIN MEMBER;

26 (b) Write the output of the queries (i) to (iv) based on the table 3
Table: Employee
EID Name DOB DOJ Salary Project
E01 Ranjan 1990-07-12 2015-01-21 150000 P01
E02 Akhtar 1992-06-21 2015-02-01 125000 P04
E03 Muneera 1996-11-15 2018-08-19 135000 P01
E04 Alex 1991-10-25 2018-10-19 75000 P02
E05 Satyansh 1993-12-16 2018-10-19 85000 P04
i SELECT NAME, PROJECT FROM EMPLOYEE ORDER BY NAME
DESC;
ii SELECT NAME, SALARY FROM EMPLOYEE WHERE NAME LIKE
'A%';
iii SELECT NAME, DOJ FROM EMPLOYEE WHERE SALARY
BETWEEN 100000 AND 200000;

25
iv SELECT * FROM EMPLOYEE WHERE PROJECT = 'P01';

27 (a) Consider the following tables – FACULTY and COURSES :


Table: FACULTY
FID FNAME LNAME JOINDATE SALARY
F01 Anishma Garg 2000-12-14 32000
F03 Bhumi Goel 2001-08-10 15000
F04 Neha Verma 2000-05-17 27000
F05 Meenu Sharma 2006-07-11 30000

27 Table: COURSES 3
C_ID FID CNAME FEES
C11 F01 Grid Computing 40000
C12 F04 Python 17000
C13 F03 C++ 8000
C14 F04 Computer Network 15000
C15 F01 HTML 12000
C16 F05 Data Science NULL
What will be the output of the following statement?
i SELECT FID, MIN(FEES), MAX(FEES) FROM COURSES GROUP BY FID;
ii SELECT AVG(SALARY) FROM FACULTY WHERE FNAME LIKE '%a';
iii SELECT FNAME, CNAME FROM FACULTY F, COURSES C WHERE
F.FID=C.FID AND COURSES.FID='F04';
iv SELECT FNAME, CNAME , FEES FROM FACULTY F , COURSES C WHERE
F.FID = C.FID AND FEE>15000;

(b) Write the name of the command to display the structure of a


table in a database.

26
28 Write a function COUNT() in Python to read from a text file
'Gratitude.txt' and display the count of the letter 'e' in each line
Example: If the file content is as follows:
Gratitude is a humble heart's radiant glow, A
timeless gift that nurtures and bestows. It's
the appreciation for the love we're shown, In
moments big and small, it's truly known.
The COUNT() function should display the output as:
Line 1 : 3
Line 2 : 4
Line 3 : 6
Line 4 : 1
OR
Write a function Start_with_I() in Python, which should read a text
file 'Gratitude.txt'(as given above) and then display lines starting
with 'I'.

Example: If the file content is as follows:


Then the output should be
It's the appreciation for the love we're shown, In
moments big and small, it's truly known.
29 Navdeep creates a table RESULT with a set of records to maintain the
marks secured by students in Sem1, Sem2, Sem3, and their divisions.
After the creation of the table, he entered data of 7 students in the
table.

ADNO ROLLNO SNAME SEM1 SEM2 DIVISION


123 101 KARAN 366 410 I
245 102 NAMAN 300 350 I
128 103 ISHA 400 410 I
129 104 RENU 350 357 I
234 105 ARPIT 100 75 IV
187 106 SABINA 100 205 II
181 107 NEELAM 470 450 I
Based on the data given above answer the following questions:
i Identify the columns which can be considered as candidate keys?
ii If 2 more columns are added and 3 rows are deleted from the table
result, what will be the new degree and cardinality of the above
table?
iii Write a statement to increase the SEM2 marks by 3% for the
students securing marks between 70 to 100.

27
30 Given a Dictionary Stu_dict containing marks of students for three
test-series in the form Stu_ID:(TS1, TS2, TS3) as key-value pairs. Write a
Python program with the following user-defined functions to perform
the specified operations on a stack named Stu_Stk
(i) Push_elements(Stu_Stk, Stu_dict) : It allows pushing

IDs of those students, from the dictionary Stu_dict into the stack
Stu_Stk, who have scored more than or equal to 80 marks in the TS3
Test.
(ii) Pop_elements(Stu_Stk): It removes all elements present
inside the stack in LIFO order and prints them. Also, the function displays
'Stack Empty' when there are no elements in the stack. Call both
functions to execute queries.

For example:
If the dictionary Stu_dict contains the following data:
Stu_dict ={5:(87,68,89), 10:(57,54,61), 12:(71,67,90),
14:(66,81,80), 18:(80,48,91)}

After executing Push_elements(),


Stk_ID should contain
[5,12,14,18]
After executing Pop_elements(), The output should be:
18
14
12
5
Stack Empty

Q No. Questions Section-D (8 Marks) Marks


31 Create a function maxsalary() in Python to read all the records from 4
an already existing file record.csv which stores the records of various
employees working in a department. Data is stored under various fields
as shown below:
E_code E_name Scale Salary
A01 Bijesh Mehra S4 65400
B02 Vikram Goel S3 60000
C09 Suraj Mehta S2 45300
…… …… …… ……
Function should display the row where the salary is maximum.
Note: Assume that all employees have distinct salary.

28
32 Consider a binary file 'INVENTORY.DAT' that stores information about 4
products using tuple with the structure (ProductID, ProductName,
Quantity, Price). Write a Python function
expensiveProducts() to read the contents of
'INVENTORY.DAT' and display details of products with a price higher
than Rs. 1000. Additionally, calculate and display the total count of such
expensive products.

For example: If the file stores the following data in binary format
(1, 'ABC', 100, 5000)
(2, 'DEF', 250, 1000) (3,
'GHI', 300, 2000)
then the function should display
Product ID: 1
Product ID: 3
Total expensive products: 2
Q No. Questions Section-E (15 Marks) Marks
33 Fun Media Services Ltd is an event planning organization. It is planning
to set up its India campus in Mumbai with its head office in Delhi. The
Mumbai campus will have four blocks/buildings - ADMIN, DECORATORS,
FOOD, and MEDIA.
You as a network expert need to suggest the best network-related
solutions for them to resolve the issues/problems mentioned in points
(i) to (v), keeping in mind the distances between various
blocks/buildings and other given parameters.

Shortest distance between various buildings: 5


FROM – TO DISTANCE
ADMIN TO DECORATORS 90 meters
ADMIN TO MEDIA 75 meters
ADMIN TO FOOD 50 meters
DECORATORS TO FOOD 65 meters
DECORATORS TO MEDIA 50 meters
FOOD TO MEDIA 45 meters
DELHI Head Office to MUMBAI Campus 1475 KM

29
The number of computers at various buildings is as follows:
BUILDING NUMBER OF
COMPUTERS
ADMIN 110
DECORATORS 75
MEDIA 12
FOOD 20
i) Suggest the most appropriate location of the server inside the
MUMBAI campus (out of the 4 buildings). Justify your answer.
ii) Draw the cable layout to efficiently connect various buildings within
the MUMBAI campus. iii. Which hardware device will you suggest to
connect all the computers within each building?
Iii) Which of the following will you suggest to establish online face-to-
face communication between the people in the Admin Office of the
MUMBAI campus and the DELHI Head Office?
a. Cable TV b) Email c) Video Conferencing d) Text Chat
Iv) What type of network (out of PAN, LAN, MAN, WAN) will be set up in
each of the following cases?
a. The Mumbai campus gets connected with the Head Quarter in
Delhi
b. The computers connected in the MUMBAI campus
34 i) Mention any two differences between seek() and tell().
ii) Consider a file FLIGHT.DAT containing multiple records. The structure
of each record is as shown below:
[Fno, FName, Fare, Source, Destination]
Write a function COPY_REC() in Python that copies all those records
from FLIGHT.DAT where the source is DELHI and the
destination is MUMBAI, into a new file RECORD.DAT
OR

34 i) Mention any two differences between binary files and csv files? 2+3=5
ii) Consider a Binary file BOOK.DAT containing a dictionary having
multiple elements. Each element is in the form
BNO:[BNAME,BTYPE,PRICE] as key:value pair where
BNO – Book Number
BNAME – Book Name
BTYPE - Book Type
PRICE – Book price
Write a user-defined function, findBook(price), that accepts price as
parameter and displays all those records from the binary file BOOK.DAT
which has a book price more than or equal to the price value passed as a
parameter.

30
35 i. Define the term constraint with respect to RDBMS. Give a suitable
example.
ii. Sameera maintains a database named STORE which contains a
table named ITEM with the structure given below:
• Ino(Item number )- integer
• Iname(Item Name) – string
• Price (Item Price) – float
• Discount (Discount) – float
Note the following to establish connectivity between Python and
MySQL:
• Username - root
• Password - tiger
• Host - localhost
Write a python code with mysql connectivity to remove the record from
the table ITEM for a particular value of item name input by the user.
OR
i. Write one difference between the alternate key and the candidate
key.
ii. A table named ITEM is created in a database STORE. The table
contains multiple columns whose details are as shown below:
• Ino(Item number )- integer
• Iname(Item Name) – string
• Price (Item Price) – float
• Discount (Discount) – float
Note the following to establish connectivity between Python and MySQL:
• Username - root
• Password - tiger
• Host - localhost
Write a python code with mysql connectivity to run the query to display
details of all such items from the table ITEMS whose price is more than
5000.



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39
Std :XII II MID TERM – 2024-25 Time : 3 Hrs
Subject : Computer Science SET - 2 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
7. All questions are compulsory.
8. Section A have 18 questions carrying 01 mark each.
9. Section B has 07 Very Short Answer type questions carrying 02 marks each.
10. Section C has 05 Short Answer type questions carrying 03 marks each.
11. Section D has 02 Long Answer type questions carrying 04 marks each.

31
12. Section E has 03 questions carrying 04 marks each.
6 6. ‘L’ in HTML stands for : 1
(A) Large (b) Long (c) Language (D) Laser
7 Identify the valid Python identifier from the following : 1
(A) 2user (b) user 2 (c) user@2 (D) user 2
8 Consider the statements given below and then choose the correct output 1
from the given options 1
Game="World Cup 2023"
print(Game[-6::-1])
(A) CdrH (b) puC dlroW (c) ce o (D) Error

Q No. Questions Section-A (18 Marks) Marks


1 State True or False 1
“In Python, tuple is a mutable data type”.

2 The primary key is selected from the set of 1


(A) composite keys (B) alternate keys
(C) candidate keys (D) foreign keys
3 What will be the output of the following statement ? 1
print(6+5/4**2//5+8)
a) -14. 0 b) 14.0 (C) 14 d) -14
4 Select the correct output of the code : 1
S = "text#next" print(S.strip("t"))
(A) ext#nex (B) ex#nex (C) text#nex (D) ext#nex
5 In SQL, what command will be used to add a new record in a table? 1
(A) UPDATE (B) ADD (c) INSERT (d) ALTER TABLE
9 Predict the output :of the 1
>>>import statistics as s
>>>s.mode ([10, 20, 10, 30, 10, 20, 30])
(A) 30 (B) 20 (C) 10 (D) 18.57
10 Which of the following output will never be obtained when the given code 1
is 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

32
11 11. Ethernet card is also known as : 1 1
(A) LIC (b) NIC (c) MIC (d) OIC
12 What will be the output of the given code ? 1 1
a=10
def convert(b=20):
a=30
c=a+b
print(a,c)
convert(30)
print(a)
13 For the following Python statement : 1 1
N = (25)
What shall be the type of N ?
(A) Integer (B) String (C) Tuple (D) List
14 Mr. Ravi is creating a field that contains alphanumeric values and fixed 1
lengths. Which MySQL data type should he choose for the same ?
(A) VARCHAR b) CHAR c) LONG d) NUMBER
15 Fill in the blank : 1 1
The full form of WWW is
16 ______files are stored in a computer in a sequence of bytes. 1 1
a) Text b) Binary (c) csv (D) Notepad
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) : 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.
18 Assertion (A) : If numeric data are to be written to a text file, the 1
data needs to be 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.
Q No. Questions Section-B (14 Marks) Marks
19 Write two advantages and two disadvantages of circuit switching. 2
OR
Differentiate between Web server and web browser. Write the names of
any two web browsers.

33
20 Rewrite the following code in Python after removing all the syntax errors. 2
Underline each correction done in the code.
num1, num2 = 10, 45
While num1 % num2 ==
0 num1+= 20 num2+=
30
Else:
print('hello')
21 Write a function dispBook(BOOKS) in Python, that takes a dictionary
BOOKS as an argument and displays the names in uppercase of those
books whose name starts with a consonant.

For example, Consider the following dictionary

BOOKS = {1:"Python", 2:"Internet Fundamentals ",


3:"Networking ",
4:"Oracle sets", 5:"Understanding HTML"}

The output should be:


PYTHON NETWORKING
OR
21 Write a Python Program containing a function FindWord(STRING, 2
SEARCH), that accepts two arguments : STRING and SEARCH, and prints
the count of occurrence of SEARCH in STRING. Write appropriate
statements to call the function.

For example, if STRING = "Learning history helps to know about history


with interest in history" and SEARCH = 'history', the function should
display
The word history occurs 3 times.
22 What will be the output of the following code? 2

L = [5,10,15,1] G =
4 def Change(X):
global G
N=len(X) for i
in range(N):
X[i] += G

Change(L)
for i in L:
print(i,end='$')

34
23 Write a suitable Python statement for each of the following tasks using 2
built-in functions/methods only:
i To delete an element Mumbai:50 from Dictionary D. ii To
display words in a string S in the form of a list
OR
Write a Python Program to display alternate characters of a string
my_str.
For example, if my_str = "Computer Science"
The output should be Cmue cec
24 Differentiate between % (percentage) and _(underscore) characters used 2
with the LIKE operator in SQL with appropriate examples.
OR
Differentiate between DROP and DELETE commands in SQL with
appropriate examples.
25 Consider the following two commands with reference to a table, named 2
Employee having a column named Department:
(a) Select count(Department) from Employee;
(b) Select count(*) from Employee;

If these two commands are producing different results,


(i) What may be the possible reason?
(ii) Which command (a) or (b) might be giving a higher value?
Q No Questions Section-C (15 Marks) Marks
26 (a) Consider the table, BOOK and MEMBER given below:
TABLE : BOOK
CODE BNAME TYPE
F101 The priest Fiction
L102 Easy Python Programming
C101 Juman Ji Thriller
F102 Untold Story Fiction
C102 War Stories Comic
Table: MEMBER
MNO MNAME CODE ISSUEDATE
M101 SNEH SINHA L102 2022-10-13
M103 SARTHAK F102 2021-02-23
M102 SARA KHAN C101 2022-06-12
What will be the output of the following statement?
SELECT * FROM BOOK NATURAL JOIN MEMBER;

35
26 (a) Write the output of the queries (i) to (iv) based on the table 3
Table: Employee
EID Name DOB DOJ Salary Project
E01 Ranjan 1990-07-12 2015-01-21 150000 P01
E02 Akhtar 1992-06-21 2015-02-01 125000 P04
E03 Muneera 1996-11-15 2018-08-19 135000 P01
E04 Alex 1991-10-25 2018-10-19 75000 P02
E05 Satyansh 1993-12-16 2018-10-19 85000 P04
i SELECT NAME, PROJECT FROM EMPLOYEE ORDER BY NAME
DESC;
ii SELECT NAME, SALARY FROM EMPLOYEE WHERE NAME LIKE
'A%';
iii SELECT NAME, DOJ FROM EMPLOYEE WHERE SALARY
BETWEEN 100000 AND 200000;
iv SELECT * FROM EMPLOYEE WHERE PROJECT = 'P01';
27 (a) Consider the following tables – FACULTY and COURSES :
Table: FACULTY
FID FNAME LNAME JOINDATE SALARY
F01 Anishma Garg 2000-12-14 32000
F03 Bhumi Goel 2001-08-10 15000
F04 Neha Verma 2000-05-17 27000
F05 Meenu Sharma 2006-07-11 30000

Table: COURSES
C_ID FID CNAME FEES
C11 F01 Grid Computing 40000
C12 F04 Python 17000
C13 F03 C++ 8000
C14 F04 Computer Network 15000
C15 F01 HTML 12000
C16 F05 Data Science NULL
27 What will be the output of the following statement? 3
i SELECT FID, MIN(FEES), MAX(FEES) FROM COURSES GROUP
BY FID;
ii SELECT AVG(SALARY) FROM FACULTY WHERE FNAME LIKE
'%a';
iii SELECT FNAME, CNAME FROM FACULTY F, COURSES C WHERE
F.FID=C.FID AND COURSES.FID='F04';
iv SELECT FNAME, CNAME , FEES FROM FACULTY F , COURSES

36
C WHERE F.FID = C.FID AND FEE>15000;

(b) Write the name of the command to display the structure of a table
in a database.
Write a function COUNT() in Python to read from a text file
'Gratitude.txt' and display the count of the letter 'e' in each line
Example: If the file content is as follows:
Gratitude is a humble heart's radiant glow, A
timeless gift that nurtures and bestows. It's
the appreciation for the love we're shown, In
moments big and small, it's truly known.
The COUNT() function should display the output as:
Line 1 : 3
Line 2 : 4
Line 3 : 6
Line 4 : 1
OR
Write a function Start_with_I() in Python, which should read a text
file 'Gratitude.txt' and then display lines starting with 'I'.
Example: If the file content is as follows:

Gratitude is a humble heart's radiant glow, A


timeless gift that nurtures and bestows. It's
the appreciation for the love we're shown, In
moments big and small, it's truly known.
Then the output should be
It's the appreciation for the love we're shown, In
moments big and small, it's truly known.
29 Navdeep creates a table RESULT with a set of records to maintain the
marks secured by students in Sem1, Sem2, Sem3, and their divisions.
After the creation of the table, he entered data of 7 students in the table.
ADNO ROLLNO SNAME SEM1 SEM2 DIVISION
123 101 KARAN 366 410 I
245 102 NAMAN 300 350 I
128 103 ISHA 400 410 I
129 104 RENU 350 357 I
234 105 ARPIT 100 75 IV
187 106 SABINA 100 205 II
181 107 NEELAM 470 450 I
Based on the data given above answer the following questions:
i Identify the columns which can be considered as candidate keys?
ii If 2 more columns are added and 3 rows are deleted from the table

37
result, what will be the new degree and cardinality of the above
table?
iii Write a statement to increase the SEM2 marks by 3% for the students
securing marks between 70 to 100.

30 Given a Dictionary Stu_dict containing marks of students for three test-


series in the form Stu_ID:(TS1, TS2, TS3) as key-value pairs. Write a
Python program with the following user-defined functions to perform the
specified operations on a stack named Stu_Stk
(i) Push_elements(Stu_Stk, Stu_dict) : It allows pushing

IDs of those students, from the dictionary Stu_dict into the stack
Stu_Stk, who have scored more than or equal to 80 marks in the TS3
Test.
(ii) Pop_elements(Stu_Stk): It removes all elements present
inside the stack in LIFO order and prints them. Also, the function displays
'Stack Empty' when there are no elements in the stack. Call both
functions to execute queries.

For example:
If the dictionary Stu_dict contains the following data:
Stu_dict ={5:(87,68,89), 10:(57,54,61), 12:(71,67,90),
14:(66,81,80), 18:(80,48,91)}

After executing Push_elements(),


Stk_ID should contain
[5,12,14,18]
After executing Pop_elements(), The output should be:
18
14
12
5
Stack Empty

Q No. Questions Section-D (8 Marks) Marks

38
31 Create a function maxsalary() in Python to read all the records from 4
an already existing file record.csv which stores the records of various
employees working in a department. Data is stored under various fields
as shown below:
E_code E_name Scale Salary
A01 Bijesh Mehra S4 65400
B02 Vikram Goel S3 60000
C09 Suraj Mehta S2 45300
…… …… …… ……
Function should display the row where the salary is maximum.
Note: Assume that all employees have distinct salary.
32 Consider a binary file 'INVENTORY.DAT' that stores information about 4
products using tuple with the structure (ProductID, ProductName,
Quantity, Price). Write a Python function
expensiveProducts() to read the contents of
'INVENTORY.DAT' and display details of products with a price higher
than Rs. 1000. Additionally, calculate and display the total count of such
expensive products.

For example: If the file stores the following data in binary format
(1, 'ABC', 100, 5000)
(2, 'DEF', 250, 1000) (3,
'GHI', 300, 2000)
then the function should display
Product ID: 1
Product ID: 3
Total expensive products: 2
Q No. Questions Section-E (15 Marks) Marks
33 Fun Media Services Ltd is an event planning organization. It is planning to
set up its India campus in Mumbai with its head office in Delhi. The
Mumbai campus will have four blocks/buildings - ADMIN, DECORATORS,
FOOD, and MEDIA.
You as a network expert need to suggest the best network-related
solutions for them to resolve the issues/problems mentioned in points (i)
to (v), keeping in mind the distances between various blocks/buildings
and other given parameters.

39
5

Shortest distance between various buildings:


FROM – TO DISTANCE
ADMIN TO DECORATORS 90 meters
ADMIN TO MEDIA 75 meters
ADMIN TO FOOD 50 meters
DECORATORS TO FOOD 65 meters
DECORATORS TO MEDIA 50 meters
FOOD TO MEDIA 45 meters
DELHI Head Office to MUMBAI Campus 1475 KM
The number of computers at various buildings is as follows:
BUILDING NUMBER OF
COMPUTERS
ADMIN 110
DECORATORS 75
MEDIA 12
FOOD 20
i) Suggest the most appropriate location of the server inside the MUMBAI
campus (out of the 4 buildings). Justify your answer.
ii) Draw the cable layout to efficiently connect various buildings within the
MUMBAI campus. iii. Which hardware device will you suggest to connect
all the computers within each building?
Iii) Which of the following will you suggest to establish online face-to-face
communication between the people in the Admin Office of the MUMBAI
campus and the DELHI Head Office?
a. Cable TV b) Email c) Video Conferencing d) Text Chat
Iv) What type of network (out of PAN, LAN, MAN, WAN) will be set up in
each of the following cases?
a. The Mumbai campus gets connected with the Head Quarter in
Delhi
b. The computers connected in the MUMBAI campus

40
34 i) Mention any two differences between seek() and tell(). 2+3=5
ii) Consider a file FLIGHT.DAT containing multiple records. The structure
of each record is as shown below:
[Fno, FName, Fare, Source, Destination]
Write a function COPY_REC() in Python that copies all those records from
FLIGHT.DAT where the source is DELHI and the
destination is MUMBAI, into a new file RECORD.DAT
OR
i) Mention any two differences between binary files and csv files?
ii) Consider a Binary file BOOK.DAT containing a dictionary having multiple
elements. Each element is in the form BNO:[BNAME,BTYPE,PRICE] as
key:value pair where
BNO – Book Number
BNAME – Book Name
BTYPE - Book Type
PRICE – Book price
Write a user-defined function, findBook(price), that accepts price as
parameter and displays all those records from the binary file BOOK.DAT
which has a book price more than or equal to the price value passed as a
parameter.

35 i. Define the term constraint with respect to RDBMS. Give a suitable


example.
ii. Sameera maintains a database named STORE which contains a table
named ITEM with the structure given below:
• Ino(Item number )- integer
• Iname(Item Name) – string
• Price (Item Price) – float
• Discount (Discount) – float
Note the following to establish connectivity between Python and
MySQL:
• Username - root
• Password - tiger
• Host - localhost
Write a python code with mysql connectivity to remove the record from
the table ITEM for a particular value of item name input by the user.
OR
i. Write one difference between the alternate key and the candidate
key.
ii. A table named ITEM is created in a database STORE. The table
contains multiple columns whose details are as shown below:
• Ino(Item number )- integer
• Iname(Item Name) – string
• Price (Item Price) – float

41
• Discount (Discount) – float
Note the following to establish connectivity between Python and MySQL:
• Username - root
• Password - tiger
• Host - localhost
Write a python code with mysql connectivity to run the query to display
details of all such items from the table ITEMS whose price is more than
5000.

 

42

Vivekananda Educational Society
Std :XI Quarterly Examination – 2024-2025 Time : 3 Hrs
Subject : Computer Science Marking Scheme - Set 2 (**) Max. Marks:70
SECTION A
1. False (it cannot be changed in place) 1
2. (d)Real 1
3. False 1
4. a) True 1
5. b) (3,4) 1
6. b. has the value True 1
7. a) List 1
8. all#around#the world 1
9. XNOR (option not given) 1
10. c) string 1
11. d) set 1
12. c) p = p – 5 1
13. b) if…elif 1
14. (a) 14.75 1
15. a) # 1
16. c) changeable 1

17. a) Both A and R are true and R is the correct explanation for A 1
18. a) Both A and R are true and R is the correct explanation for A 1
SECTION B
19. n=int(input("Enter number to check :: ")) 2
for i in range (2, n//2):
if n%i==0:
print("Number is not prime ")
break
else:
print("Number is prime”) ( ½ m for each )
20. for a in range(14,50,2): 2
print(a)
OR
a=0
while a<100:
a=a+6
print(a) (marks 1+1)
21. A’B+AB+B’C OR 2
Draw the Boolean circuit: A.B.C+(B'+C').A

22. =(assign value), += (add and assign), -= (subract and assign), *= (multiply and 2
assign), /= (divide and assign), //= (quotient and assign), **= (exponential

43
and assign), %= (modulus and assign)
½ m for 2 listing
23. Return type is str (string), it can be change used explicit type conversion 2
function like int(), float() etc 1+1
24. Can contain only a-z, A-Z, 0-9,_ 2
Cannot start with digit
Cannot be keyword (1 m each)
OR
a) 20-10 < 12
b) 14 %3 ==2 ( 1m each)
25. Predict the output of the Python code given below: 2
a)
1
3
5
7
9
(b) 4
4.25
or
1
2
3
SECTION C
26. Explain logical operators in python with example. 3
Logical operators – and, or, not
Ex :
True and True = True, True and Fasle = False, False and True = False, False
and False = False
True or True = True, True or Fasle = True, False and True = True, False and
False = False
not True = False, not False = True
(listing – 1m, example – 2m)
27 Break – the program control comes out of the loop, it can be given in loop only 3
Continue – the program control goes to the beginning of the loop, it can be
given in loop only
(1 ½ - break, 1 ½ - continue) – explanation with example can also be
considered.
Or
Else – is the last statement in ‘if’ conditional statement, it is optional, there
can be only one else in an ‘if’ statement, if must not have a condition.
elif – there can be any number of elif statement in ‘if’ conditional statement, it
is optional, there can be only one else in an ‘if’ statement, it should have
condition.
(1 ½ - else, 1 ½ - elif) – explanation with example can also be considered.
28 a) * is the repetition operator for string data, it repeats the string number of 3
times. Ex – ‘a’*5 -> aaaaa
b) ‘in’ and ‘not in’ is membership operator, is it used on a iterator it check for
the presence of a value. Ex – ‘o’ in ‘Good’ -> True
c) ‘is’ and ‘is not’ are identity operator, it is used to check whether two
variables are pointing to the same memory address
a=5
b=5

44
a is b -> True
1m for each

29 range(start, stop, step) generates a range of values from start to stop-1 in 3


steps. Default start is 0 and step is 1
ex : range(5,10,2) -> 5,7,9
30 n=int(input(‘enter n value’)) 3
sum=0
for a in range(1,n,2):
sum=sum+a
print(sum)
½ m- input, 2 m – loop and sum , ½ m – output
SECTION – D
31 Syntax error – errors when the syntax is not followed, missing ) 4
Runtime error – errors which occur during execution- unending loop
Logical error – mistaken login eg a>b; a is small
1 m – explanation, 1m for listing , 1m for each example (1+1)
32 4

SECTION – E
33 n=int(input(‘enter a number:’)) 5
for a in str(n):
if n==’1’:
print(‘one’, end=’ ‘)
elif n==’2’:
print(‘two’, end=’ ‘)
elif n==’3’:
print(‘three’, end=’ ‘)
elif n==’4’:
print(‘four’, end=’ ‘)
elif n==’5’:
print(‘five’, end=’ ‘)
elif n==’6’:

45
print(‘six’, end=’ ‘)
elif n==’7’:
print(‘seven’, end=’ ‘)
elif n==’8’:
print(‘eight’, end=’ ‘)
elif n==’9’:
print(‘nine’, end=’ ‘)
elif n==’0’:
print(‘zero’, end=’ ‘)
Or
sal=int(input(‘enter salary:’))
if sal>0 and sal<=25000:
bonus=sal*0.25
elif sal>25000 and sal<=35000:
bonus=sal*0.15
elif sal>35000 and sal<=50000:
bonus=sal*0.10
elif sal>50000 and sal<=75000:
bonus=sal*0.05
elif sal>75000:
bonus=0
print(“Bonus:”,bonus)
(Any equivalent logic can be used to produce the output)
(1 m- input, 1 m- for, 3 m – if elif)
34 Convert the following : 5
a) 342.24 (10) to binary - 101010110.0011110101110000101
b) A21.13(16) to decimal - 2593.07421875
c) 674.34(8) to decimal- 444.4375
d) 11011.1101(2) to octal - 33.64
e) 457.45(8) to binary - 100101111.100101
Or
a) 5610(8) to binary - 101110001000
b) 76.25(10) to octal - 76.25
c) 10101100.01011(2) to octal - 254.26
d) 98E(16) to hexadecimal - already in hexadecimal
e) 101101.101(2) to decimal - 45.625
35 a) Operating system - system software that manages computer hardware, 5
software resources, and provides common services for computer
programs.
b) Packages – It is bundle of application readymade for a purpose
c) Utilities software – Utility software is a type of software that is designed
to help users manage, maintain, and optimize their computer systems.
d) Application software – software designed to handle specific tasks for
users.
e) Language processors - A language processor, or translator, is a
computer program that translates source code from one programming
language to another.
1m for each definition


 

46

Vivekananda Educational Society
Std :XI Quarterly Examination – 2024-2025 Time : 3 Hrs
Subject : Computer Science Marking Scheme - Set 1 (*) Max. Marks:70
SECTION A
1. b) continue 1
2. (d)Real 1
3. False 1
4. a) True 1
5. b) (3,4) 1
6. b. has the value True 1
7. a) List 1
8. all#around#the world 1
9. XNOR (option not given) 1
10. c) string 1
11. d) set 1
12. c) p = p - 5 1
13. b) if…elif 1
14. (a) 14.75 1
15. b) # 1
16. c) changeable 1
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. a) Both A and R are true and R is the correct explanation for A 1
18. a) Both A and R are true and R is the correct explanation for A 1
SECTION B
19. n=int(input("Enter number to check :: ")) 2
for i in range (2, n//2):
if n%i==0:
print("Number is not prime ")
break
else:
print("Number is prime”) ( ½ m for each )
20. for a in range(14,50,2): 2
print(a)
OR
a=0
while a<100:
a=a+6
print(a) (marks 1+1)

47
21. A’B+AB+B’C OR 2
Draw the Boolean circuit: A.B.C+(B'+C').A

22. =(assign value), += (add and assign), -= (subract and assign), *= (multiply and 2
assign), /= (divide and assign), //= (quotient and assign), **= (exponential
and assign), %= (modulus and assign)
½ m for 2 listing
23. Return type is str (string), it can be change used explicit type conversion 2
function like int(), float() etc 1+1
24. Can contain only a-z, A-Z, 0-9,_ 2
Cannot start with digit
Cannot be keyword (1 m each)
OR
c) 20-10 < 12
d) 14 %3 ==2 ( 1m each)
25. Predict the output of the Python code given below: 2
a)
1
3
5
7
9
(b) 4
4.25
or
1
2
3
SECTION C
26. Explain logical operators in python with example. 3
Logical operators – and, or, not
Ex :
True and True = True, True and Fasle = False, False and True = False, False
and False = False
True or True = True, True or Fasle = True, False and True = True, False and
False = False
not True = False, not False = True
(listing – 1m, example – 2m)
27 Break – the program control comes out of the loop, it can be given in loop only 3
Continue – the program control goes to the beginning of the loop, it can be
given in loop only
(1 ½ - break, 1 ½ - continue) – explanation with example can also be
considered.
Or
Else – is the last statement in ‘if’ conditional statement, it is optional, there
can be only one else in an ‘if’ statement, if must not have a condition.
elif – there can be any number of elif statement in ‘if’ conditional statement, it
is optional, there can be only one else in an ‘if’ statement, it should have

48
condition.
(1 ½ - else, 1 ½ - elif) – explanation with example can also be considered.

28 d) * is the repetition operator for string data, it repeats the string number of 3
times. Ex – ‘a’*5 -> aaaaa
e) ‘in’ and ‘not in’ is membership operator, is it used on a iterator it check for
the presence of a value. Ex – ‘o’ in ‘Good’ -> True
f) ‘is’ and ‘is not’ are identity operator, it is used to check whether two
variables are pointing to the same memory address
a=5
b=5
a is b -> True
1m for each
29 range(start, stop, step) generates a range of values from start to stop-1 in 3
steps. Default start is 0 and step is 1
ex : range(5,10,2) -> 5,7,9
30 n=int(input(‘enter n value’)) 3
sum=0
for a in range(1,n,2):
sum=sum+a
print(sum)
½ m- input, 2 m – loop and sum , ½ m – output
SECTION – D
31 Repeating a set of statements until a condition is called looping. 4
for and while are looping structure in python
for a in range(1,100,2): a=5
print(a) while a<20:
print(a)
a=a+2
1 m – explanation, 1m for listing , 1m for each example (1+1)
32 a) X+YZ=(X+Y).(X+Z) 4

b) A+A’B=A+B

SECTION – E

49
33 n=int(input(‘enter a number:’)) 5
for a in str(n):
if n==’1’:
print(‘one’, end=’ ‘)
elif n==’2’:
print(‘two’, end=’ ‘)
elif n==’3’:
print(‘three’, end=’ ‘)
elif n==’4’:
print(‘four’, end=’ ‘)
elif n==’5’:
print(‘five’, end=’ ‘)
elif n==’6’:
print(‘six’, end=’ ‘)
elif n==’7’:
print(‘seven’, end=’ ‘)
elif n==’8’:
print(‘eight’, end=’ ‘)
elif n==’9’:
print(‘nine’, end=’ ‘)
elif n==’0’:
print(‘zero’, end=’ ‘)
Or
sal=int(input(‘enter salary:’))
if sal>0 and sal<=25000:
bonus=sal*0.25
elif sal>25000 and sal<=35000:
bonus=sal*0.15
elif sal>35000 and sal<=50000:
bonus=sal*0.10
elif sal>50000 and sal<=75000:
bonus=sal*0.05
elif sal>75000:
bonus=0
print(“Bonus:”,bonus)
(Any equivalent logic can be used to produce the output)
(1 m- input, 1 m- for, 3 m – if elif)
34 Convert the following : 5
f) 427.56(10) to binary - 110101001.1000111101
g) C47.15(16) to decimal - 3143.08203125
h) 573.64(8) to decimal- 379.8125
i) 11101.101(2) to decimal - 29.625
j) 723.47(8) to binary - 111010011.100111
Or
f) 100101.101(2) to decimal - 37.625
g) 605.12(8) to decimal - 389.15625
h) 100.25(10) to hexadecimal - 64.4
i) 132.45(16) to binary - 100110010.01000101
j) 65.203(8) to binary - 110101.010000011
35 f) Assembler – converts assembly language to machine language 5
g) Interpreter – converts HLL to machine language line by line.
h) System software – a program designed to run a computer's hardware
and applications and manage its resources

50
i) Software – a program designed to run a computer's hardware and
applications and manage its resources
j) Disk Defragmentor - rearranges fragmented data so your disks and
drives can work more efficiently
1m for each definition

 

51


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI I MID TERM – 2024-25 Time : 3 Hrs


Subject : Computer Science RE-TESET Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
13. All questions are compulsory.
14. Section A have 18 questions carrying 01 mark each.
15. Section B has 07 Very Short Answer type questions carrying 02 marks each.
16. Section C has 05 Short Answer type questions carrying 03 marks each.
17. Section D has 02 Long Answer type questions carrying 04 marks each.
18. Section E has 03 questions carrying 04 marks each.
19. All programming questions are to be answered using Python Language only.
SECTION A
1. Which one of the following is memory output device? 1
a) Keyboard (b) Mouse c) Pendrive (d) Scanner
2. What is the output of the expression , 5*1**5 1
(a) 125 (b) 25 (c) 5 (d) 1
3. State True or False : List is immutable and Tuple is mutable 1
4. if L= [ ‘My Score’,95.2, 2022], which data type in Python is used? 1
a. List b. String c. Dictionary d. Tuple
5. Predict the output of the following code: 1
Var=5
if Var>4 OR VAR<6 AND Var==10:
print(“Good”)
else:
print(“Not Good”)
a. Good b . Not Good c. no output d. none
6. Which one of the following is the correct extension of the Python file? 1
(a) .py (b) .python (c) .p (d) None of these
7. MICR stands for ____________________ 1
8. Write the output of 1
print((1,3),’M’,’$’,sep=’#’,end=”%”)
9. Which of the following is/are octal number(s) ? 1
(a) 1010 (b) 234/16 (c) A2B (d) 937.45
10. What shape represents a decision in a flow chart? 1
(a)Oval (b) Diamond (c) Rectangle (d) Arrow
11. Which of the following is not valid string in Python? 1
(a) “Hello” (b) ‘Hello’ (c) “Hello’ (d) None of the Above
12. What will be the output of above Python code? 1
abc="6/4"
print("abc")
(a) 1 (b) 6/4 (c) 1.5 (d) abc
13. Which of the following is a keyword in Python language? 1
(a) if (b)for (c) int (d) all above

52
14. Which of following datatype not supported by python- 1
(a) float (b) Complex (c) List (D) Date
15. Which of these is a sequence data types? 1
(a) integer ` (b) Boolean (c) List (d) Set
16. It is a ____________ Logical Gate 1

(a) XOR (b) NAND (c) AND (d) OR


Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(e) Both A and R are true and R is the correct explanation for A
(f) Both A and R are true and R is not the correct explanation for A
(g) A is True but R is False
(h) A is false but R is True
17. Assertion (A) : Comments are non-executable statements that enable the users 1
to understand the program logic.
Reason (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 users.
18. Assertion (A) : In Python, the tuple is an immutable collection of data. 1
Reason (R) : It means that any change or alteration in data, is mentioned in
the same place. The updated collection will be use the same address for its
storage.
SECTION B
19. Rewrite the following code fragments using for loop: 2
i = 10
while (i > 0) :
print (i)
i -= 3
20. Write a for loop to print the EVEN number between 11 and 70. 2
OR
Write a while loop to display the multiples of 5 from 1 to 100
21. Write the Boolean expression for the following circuit 2

or
Draw the Boolean circuit for the following expression :
XYZ’+(Z'+Y')

22. What is debugging? 2


23. What is the purpose of id() in python? 2
24. Differentiate between ‘is’ operator and ‘in’ operator with 2
example.
OR
Evaluate 13+11-6*2 > 14 or “End” and “False”
25. Draw the flowchart to find the area of a rectangle. 2
or
Draw a flowchart to find the biggest of 2 numbers.

53
SECTION C
26. What is syntax error? Give example. 3
27 What is the difference between pass and break? Explain with example. 3
Or
What is the difference between // and / operator? Explain with example.
28 What is output from the following code : 3
(i)range(6) (iii)range(5,20,4) (ii)range(7,10) (iv)range (12,1,-2) (v)
range(10,2) (vi) range(-2,-6,-2)
29 Write a loop to print the following pattern : 3
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4

Or
Write a program to print the sum of digit of a number. For Ex : if number is
342 then the sum of digits is 9 (3+4+2)
30 What is an infinite loop? Give example. 3
SECTION – D
31 Explain the different types of operators in python with example. 4
32 Draw NAND and NOR gates with truth table for 2 variables. 4
SECTION – E
33 Write a program to check whether an year is leap or not 5
Or
Write a Python program to calculate electricity bill based on :
No. of units Rate per unit
0 to 100 - Rs. 2
101 to 300 Rs. 3
Ex : if the units is 120 the amount is 200+20 x 3=260
34 Convert the following : 5
a) 251.543(10) to binary
b) 341.B(16) to decimal
c) 76.34(8) to hexadecimal
d) 1110.1101(2) to octal
e) 574.45(8) to decimal
35 Define the following and give an example for each one of them: 5
a) Dynamic RAM b) Hardware c) Secondary Memory d) Register e) bit

 

54

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII I MID TERM – 2024-25 Time : 3 Hrs


Subject : Computer Science SET 1 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.
Section A
1 What is the default delimiter of CSV? 1
2 Which is valid keyword? 1
a. Int b.WHILE c.While d.if
3 Which of the following is not a valid identifier name in Python? 1
a) 5Total b)_Radius c) pie d)While
4 Consider the following expression: 51+4-3**3//19-3 1
Which of the following will be the correct output if the expression is evaluated?
a. 50 b) 51 c) 52 d) 53
5 Select the correct output of the 1
code: Str=“Computer”
Str=Str[-4:]
print(Str*2)
a. Returetu b) uterretu c) uteruter d) None of these
6 Which module is imported for working with binary files in Python? 1
a. csv b) python-csv connector c) binary d) python.csvconnector
7 Fill in the blank: 1
Command is used to modify records in the MySQL table.
(a)ALTER (b) UPDATE (c) MODIFY (d) SELECT
8 State True or False: “In a Python program, if a break statement is given in a nested loop, 1
it terminates the execution of all loops in one go.”
9 Which of the following statement(s) would give an error after executing the following 1
code?
print(9/2) #Statement-1
print(9//2) #Statement-2
print(9%%2) #Statement-3
print(9%2) #Statement-4
(a)Statement-1 (b)Statement-2 (c)Statement-3 (d)Statement-4
10 Fill in the blanks: 1
is the table constraint used to stop null values to be entered in the field.
(i) Unique ii) Not NULL iii) Not Empty iv) None
11 The correct syntax of read() function from text files is: 1
a. file_object.read() b) file_object(read) c) read(file_object) d) file_object().read
12 Fill in the blank: 1
In SQL, we use command to display the list of databases in the server.
(a) SELECT DATABASES; b) SELECT DATABASE; c) SHOW DATABASES; d) DESC;

55
13 Fill in the blank: 1
clause is used in the SQL query to display the data in ascending order.
(a) DESC (b)ORDER BY (c)GROUP BY (d)UPDATE
14 What will the output following expression when evaluated in Python? 1
10*1*2**4-4//4
15 Which function is used to display the latest date a from table in a database? 1
(a)MAX (b)AVG (c)LARGEST (d) MIN
16 State True or False “Variable declaration is implicit in Python.” 1
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
A is false but R is True
17 Assertion (A):- If the arguments in function call statement match the number and 1
order of arguments as defined in the function definition, such arguments are called
positional arguments. Reasoning (R):- During a function call, the argument list first
contains default argument(s) followed by positional argument(s).
18 Assertion (A): CSV (Comma Separated Values) is a file format for data storage which 1
looks like a text file. Reason (R): The information is organized with one record on each
line and each field is separated by comma.
Section B
19 Rajat has written the following Python code. There are some errors in it. 2
Rewrite the correct code and underline the corrections made.
DEF execmain():
x=input("Enter a number:") if
(abs(x)=x):
print("You entered a positive number")
else:
x=*-1
print"Number made positive:"x execmain()
20 Differentiate between char and varchar in SQL with appropriate examples. 2
OR
What are different types of SQL Aggregate Functions? Give two examples.
21 a. Find output generated by the following 1+1
code: mystr = “Hello I am a Human.”
print(mystr[::-3])

b. Write the output of the code given


below: p=10
q=20
p*=q//3
p=q**2
q+=p
print(p,q)
22 Differentiate between DDL and DML with one Example each. 2
23 Write a user defined function in Python named showGrades (S) which takes the 2
dictionary S as an argument. The dictionary, S contains Name: [Eng, Math, Science] as
key: value pairs. The function displays the corresponding grade obtained by the students
according to the following grading rules:
Average of Eng, Math, Science Grade
>=90 A
<90 but >=60 B

56
<60 C
For example: Consider the following dictionary
S={"AMIT": [92,86,64],"NAGMA": [65, 42, 43], "DAVID": [92,90,88]}
The output should be:
AMIT B
NAGMA C
DAVID A
Or
Write a user defined function in Python named Puzzle (W, N) which takes the argument
Was an English word and N as an integer and returns the string where every Nth
alphabet of the word is replaced with an underscore ("_").
For example: if W contains the word "TELEVISION" and N is 3, then the function should
return the string "TE_EV_SI_N". Likewise for the word "TELEVISION" if N is 4, then the
function should return "TEL_VIS_ON".
24 Predict the output of the following code:
mylist=[2,14,54,22,17]
tup=tuple(mylist)
for i in tup:
print(i%3, end=",") or
24 def CALLME(n1=1,n2=2): 2
n1=n1*n2
n2+=2
print(n1,n2)
CALLME()
CALLME(3)
25 (A) Write the Python statement for each of the following tasks using built-in 2
functions/methods only:
(i) To remove the item whose key is "NISHA" from a dictionary named Students.
For example, if the dictionary Students contains {"ANITA":90, "NISHA": 76, "ASHA":92),
then after removal the dictionary should contain ("ANITA":90, "ASHA":92}
(ii) To display the number of occurrences of the substring "is" in a string named
message. For example if the string message contains "This is his book", then the output
will be 3.
OR
(B) A tuple named subject stores the names of different subjects. Write the Python
commands to convert the given tuple to a list and thereafter delete the last element of
the list.
Section-C
26 a. Consider the following tables Trainer and Course: 1+2

57
What will be the output of the following statement? SELECT * FROM TRAINER NATURAL
JOIN COURSE;

a. Write the Outputs of the MySQL queries(i) to(iv)based on the given above tables:
i. SELECT DISTINCT(CITY) FROM TRAINER WHERE SALARY>80000;
ii. SELECT TID,COUNT(*),MAX(FEES) FROM COURSE GROUP BY TID HAVING
COUNT(*)>1;

iii. SELECT T.TNAME,C.CNAME FROM TRAINER T,COURSE C WHERE T.TID=C.TID AND


T.FEES<10000;
iv. SELECT COUNT(CITY),CITY FROM TRAINER GROUP BY CITY;
27 (A) Write a user defined function in Python named showInLines() which reads contents of
a text file named STORY.TXT and displays every sentence in a separate line.Assume that a
sentence ends with a full stop (.), a question mark (?), or an exclamation mark (!).
For example, if the content of file STORY. TXT is as follows:
Our parents told us that we must eat vegetables to be healthy. And it turns out, our
parents were right! So, what else did our parents tell?
Then the function should display the file's content as follows:
Our parents told us that we must eat vegetables to be healthy.
And it turns out, our parents were right! So, what else did our parents tell?
OR
(B) Write a function, c_words () in Python that separately counts and displays the number
of uppercase and lowercase alphabets in a text file, Words.txt.
28 Python function oddeve(L) to print positive numbers in a list L. 3
Example: Input:[4, -1,5, 9,-6, 2,-9, 8]
Output: [4, 5, 9, 2,8]
29 Write the output on execution of the following 3
Python code:
S="Racecar Car Radar" L=S.split()
for Win L:
x=W.upper()
if x==x[::-1]:
for I in x:
print (I, end="*")
else:
for I in W:
print (I, end="#")
print()
30 a. Write the outputs of the SQL queries (i) to (iv)based on the relations Teacher and 3
Posting given below:

58
i. SELECT Department, count(*) FROM Teacher GROUP BY Department;
ii. SELECT Max(Date_of_Join),Min(Date_of_Join) FROM Teacher;
iii. SELECT Teacher.name, Teacher.Department, Posting.Place FROM Teacher, Posting
WHERE Teacher.Department=Posting.Department AND Posting.Place=”Delhi”;
iv. SELECT Gender, COUNT(Gender) FROM Teacher GROUP BY Gender;

b.Write the command to view the schema of the table Teacher.


Section-D
31 Aman is a Python programmer. He has written a code and created a binary file 4
record.dat with employeeid, ename and salary. The file contains 10 records.
Write the code to update a record based on the employee id entered by the user and
update the salary.
32 Consider the following dept and worker tables. Find outputs for sql queries (i) to (iii): 4
Table : DEPT
DCODE DEPARTMENT CITY
D01 MEDIA DELHI
D02 MARKETING DELHI
D03 INFRASTRUCTURE MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI
Table : WORKER
WNO NAME DOJ DOB GENDER DCODE
1001 George K 2013-09-01 1991-09-01 MALE D01
1002 Ryma Sen 2012-12-11 1990-12-15 FEMALE D03
1003 Mohitesh 2013-02-03 1987-09-04 MALE D05
1007 Anil Jha 2014-01-17 1984-10-19 MALE D04
1004 Manila Sahai 2012-12-09 1986-11-14 FEMALE D01
1005 S SAHAY 2013-11-18 1987-03-31 MALE D02
1006 Jaya Priya 2014-06-09 1985-06-23 FEMALE D05

59
i) Display no. of employees from each department
ii) Display details of workers from Finance department
iii) Show the name and age of the workers when they joined the company.
iv) Show the names of the workers whose name starts with ‘M’ or ‘G’

Section-E
33 What is the use of tell() function? 1+4
Write a program in Python that defines and calls the following user defined functions:
i. Add(): to add the record of a student to a csv file “record.csv”. Each record
should be with field elements [admno,sname,class]
ii. Count(): to count the number of students studying in class 12
OR
Give a difference between dump and load function. Write a program in Python that
defines and calls the following user defined functions:
i. Add(): to add the record of an animal to a csv file “animal.csv”. Each record
should be with field elements [animalname, animaltype, animalfood]
ii. Search(): to print all the animal names who eat grass as their food.
34 (a) Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES as an 3+2
argument and displays the names (in uppercase)of the places whose names are longer
than 5 characters. For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be:
LONDON
NEW YORK
(b)Find the output
Msg1="WeLcOME"
Msg2="GUeSTs" Msg3=""
for Iin range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print(Msg3)
35 What is the advantage of using pickle module? 5
Write a program to write into a CSV file “one.csv” Rollno, Name and Marks separated
by comma. It should have header row and then take input from the user for all
following rows. The format of the file should be as shown if user enters 2 records.
Roll.No, Name, Marks
20, Ronit, 67
56, Nihir, 69
OR
What is difference between tell() and seek()methods?
Write a program to read all content of “student.csv” and display records of only those
students who scored more than 80 marks. Records stored in students is in format :
[Rollno, Name, Marks]

60
 

61

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII I MID TERM – 2024-25 Time : 3 Hrs


Subject : Computer Science SET 2 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.
Section A
1 Write full form of CSV. 1
2 Which is valid keyword? 1
b. Int b.WHILE c.While d.if
3 Which of the following is not a valid identifier name in Python? 1
a) 5Total b)_Radius c) pie d)While
4 Consider the following expression: 51+4-3**3//19-3 1
Which of the following will be the correct output if the expression is evaluated?
b. 50 b) 51 c) 52 d) 53
5 Select the correct output of the 1
code: Str=“Computer”
Str=Str[-4:]
print(Str*2)
b. Returetu b) uterretu c) uteruter d) None of these
6 Which module is imported for working with binary files in Python? 1
b. csv b) python-csv connector c) binary d) python.csvconnector
7 Fill in the blank: 1
Command is used to modify records in the MySQL table.
(a)ALTER (b) UPDATE (c) MODIFY (d) SELECT
8 State True or False: “In a Python program, if a break statement is given in a nested loop, 1
it terminates the execution of all loops in one go.”
9 Which of the following statement(s) would give an error after executing the following 1
code?
print(9/2) #Statement-1
print(9//2) #Statement-2
print(9%%2) #Statement-3
print(9%2) #Statement-4
(a)Statement-1 (b)Statement-2 (c)Statement-3 (d)Statement-4
10 Fill in the blanks: 1
is the table constraint used to stop null values to be entered in the field.
(ii) Unique ii) Not NULL iii) Not Empty iv) None
11 The correct syntax of read() function from text files is: 1
b. file_object.read() b) file_object(read) c) read(file_object) d) file_object().read
12 Fill in the blank: 1
In SQL, we use command to display the list of databases in the server.
(b) SELECT DATABASES; b) SELECT DATABASE; c) SHOW DATABASES; d) DESC;

62
13 Fill in the blank: 1
clause is used in the SQL query to display the data in ascending order.
(b) DESC (b)ORDER BY (c)GROUP BY (d)UPDATE
14 What will the output following expression when evaluated in Python? 1
10*1*2**4-4//4
15 Which function is used to display the latest date a from table in a database? 1
(a)MAX (b)AVG (c)LARGEST (d) MIN
16 State True or False “Variable declaration is implicit in Python.” 1
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as:
(d) Both A and R are true and R is the correct explanation for A
(e) Both A and R are true and R is not the correct explanation for A
(f) A is True but R is False
A is false but R is True
17 Assertion (A):- If the arguments in function call statement match the number and 1
order of arguments as defined in the function definition, such arguments are called
positional arguments. Reasoning (R):- During a function call, the argument list first
contains default argument(s) followed by positional argument(s).
18 Assertion (A): CSV (Comma Separated Values) is a file format for data storage which 1
looks like a text file. Reason (R): The information is organized with one record on each
line and each field is separated by comma.
Section B
19 Rajat has written the following Python code. There are some errors in it. 2
Rewrite the correct code and underline the corrections made.
DEF execmain():
x=input("Enter a number:") if
(abs(x)=x):
print("You entered a positive number")
else:
x=*-1
print"Number made positive:"x execmain()
20 Differentiate between char and varchar in SQL with appropriate examples. 2
OR
What are different types of SQL Aggregate Functions? Give two examples.
21 c. Find output generated by the following 1+1
code: mystr = “Hello I am a Human.”
print(mystr[::-3])

d. Write the output of the code given


below: p=10
q=20
p*=q//3
p=q**2
q+=p
print(p,q)
22 Differentiate between DDL and DML with one Example each. 2
23 Write a user defined function in Python named showGrades (S) which takes the 2
dictionary S as an argument. The dictionary, S contains Name: [Eng, Math, Science] as
key: value pairs. The function displays the corresponding grade obtained by the students
according to the following grading rules:
Average of Eng, Math, Science Grade
>=90 A
<90 but >=60 B

63
<60 C
For example: Consider the following dictionary
S={"AMIT": [92,86,64],"NAGMA": [65, 42, 43], "DAVID": [92,90,88]}
The output should be:
AMIT B
NAGMA C
DAVID A
Or
Write a user defined function in Python named Puzzle (W, N) which takes the argument
Was an English word and N as an integer and returns the string where every Nth
alphabet of the word is replaced with an underscore ("_").
For example: if W contains the word "TELEVISION" and N is 3, then the function should
return the string "TE_EV_SI_N". Likewise for the word "TELEVISION" if N is 4, then the
function should return "TEL_VIS_ON".
24 Predict the output of the following code:
mylist=[2,14,54,22,17]
tup=tuple(mylist)
for i in tup:
print(i%3, end=",") or
24 def CALLME(n1=1,n2=2): 2
n1=n1*n2
n2+=2
print(n1,n2)
CALLME()
CALLME(3)
25 (A) Write the Python statement for each of the following tasks using built-in 2
functions/methods only:
(i) To remove the item whose key is "NISHA" from a dictionary named Students.
For example, if the dictionary Students contains {"ANITA":90, "NISHA": 76, "ASHA":92),
then after removal the dictionary should contain ("ANITA":90, "ASHA":92}
(ii) To display the number of occurrences of the substring "is" in a string named
message. For example if the string message contains "This is his book", then the output
will be 3.
OR
(B) A tuple named subject stores the names of different subjects. Write the Python
commands to convert the given tuple to a list and thereafter delete the last element of
the list.
Section-C
26 a. Consider the following tables Trainer and Course: 1+2

64
What will be the output of the following statement?
SELECT * FROM TRAINER NATURAL JOIN COURSE;

b. Write the Outputs of the MySQL queries(i) to(iv)based on the given above tables:
a. SELECT DISTINCT(CITY) FROM TRAINER WHERE SALARY>80000;
b. SELECT TID,COUNT(*),MAX(FEES) FROM COURSE GROUP BY TID HAVING
COUNT(*)>1;
c. SELECT T.TNAME,C.CNAME FROM TRAINER T,COURSE C WHERE T.TID=C.TID AND
T.FEES<10000;
SELECT COUNT(CITY),CITY FROM TRAINER GROUP BY CITY;
27 (A) Write a user defined function in Python named showInLines() which reads contents of
a text file named STORY.TXT and displays every sentence in a separate line.Assume that a
sentence ends with a full stop (.), a question mark (?), or an exclamation mark (!).
For example, if the content of file STORY. TXT is as follows:
Our parents told us that we must eat vegetables to be healthy. And it turns out, our
parents were right! So, what else did our parents tell?
Then the function should display the file's content as follows:
Our parents told us that we must eat vegetables to be healthy.
And it turns out, our parents were right! So, what else did our parents tell?
OR
(B) Write a function, c_words () in Python that separately counts and displays the number
of uppercase and lowercase alphabets in a text file, Words.txt.
28 Python function oddeve(L) to print positive numbers in a list L. 3
Example: Input:[4, -1,5, 9,-6, 2,-9, 8]
Output: [4, 5, 9, 2,8]
29 Write the output on execution of the following 3
Python code:
S="Racecar Car Radar" L=S.split()
for Win L:
x=W.upper()
if x==x[::-1]:
for I in x:
print (I, end="*")
else:
for I in W:
print (I, end="#")
print()
30 b. Write the outputs of the SQL queries (i) to (iv)based on the relations Teacher and 3
Posting given below:

65
v. SELECT Department, count(*) FROM Teacher GROUP BY Department;
vi.SELECT Max(Date_of_Join),Min(Date_of_Join) FROM Teacher;
vii.SELECT Teacher.name, Teacher.Department, Posting.Place FROM Teacher, Posting
WHERE Teacher.Department=Posting.Department AND Posting.Place=”Delhi”;
viii. SELECT Gender, COUNT(Gender) FROM Teacher GROUP BY Gender;

b.Write the command to view the schema of the table Teacher.


Section-D
31 Aman is a Python programmer. He has written a code and created a binary file 4
record.dat with employeeid, ename and salary. The file contains 10 records.
Write the code to update a record based on the employee id entered by the user and
update the salary.
32 Consider the following dept and worker tables. Find outputs for sql queries (i) to (iii): 4
Table : DEPT
DCODE DEPARTMENT CITY
D01 MEDIA DELHI
D02 MARKETING DELHI
D03 INFRASTRUCTURE MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI
Table : WORKER
WNO NAME DOJ DOB GENDER DCODE
1001 George K 2013-09-01 1991-09-01 MALE D01
1002 Ryma Sen 2012-12-11 1990-12-15 FEMALE D03
1003 Mohitesh 2013-02-03 1987-09-04 MALE D05
1007 Anil Jha 2014-01-17 1984-10-19 MALE D04
1004 Manila Sahai 2012-12-09 1986-11-14 FEMALE D01
1005 S SAHAY 2013-11-18 1987-03-31 MALE D02
1006 Jaya Priya 2014-06-09 1985-06-23 FEMALE D05

66
v)Display no. of employees from each department
vi)Display details of workers from Finance department
vii) Show the name and age of the workers when they joined the company.
viii) Show the names of the workers whose name starts with ‘M’ or ‘G’

Section-E
33 What is the use of tell() function? 1+4
Write a program in Python that defines and calls the following user defined functions:
iii. Add(): to add the record of a student to a csv file “record.csv”. Each record
should be with field elements [admno,sname,class]
iv. Count(): to count the number of students studying in class 12
OR
Give a difference between dump and load function. Write a program in Python that
defines and calls the following user defined functions:
iii. Add(): to add the record of an animal to a csv file “animal.csv”. Each record
should be with field elements [animalname, animaltype, animalfood]
iv. Search(): to print all the animal names who eat grass as their food.
34 a) Write a function INDEX_LIST(L), where L is the list of elements passed as argument to the 3+2
function. The function returns another list named ‘indexList’ that stores the indices of all
Non-Zero Elements of L.
For example: If L contains [12,4,0,11,0,56] The indexList will have - [0,1,3,5]

(b)Write the output of following python code:


def result(s):
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]>='n' and s[i]<='z'): m =
m + s[i-1]
elif(s[i].isupper()):
m=m+s[i].lower()
else:
m = m +'#'
print(m)
result('Cricket')
35 What is the advantage of using pickle module?
Write a program to write into a CSV file “one.csv” Rollno, Name and Marks separated
by comma. It should have header row and then take input from the user for all
following rows. The format of the file should be as shown if user enters 2 records.
Roll.No, Name, Marks
20, Ronit, 67
56, Nihir, 69
OR
What is difference between tell() and seek()methods?
Write a program to read all content of “student.csv” and display records of only those

67
students who scored more than 80 marks. Records stored in students is in format :
[Rollno, Name, Marks]

 

68

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI I MID TERM – 2024-25 Time : 3 Hrs


Subject : Computer Science SET – 1 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
20. All questions are compulsory.
21. Section A have 18 questions carrying 01 mark each.
22. Section B has 07 Very Short Answer type questions carrying 02 marks each.
23. Section C has 05 Short Answer type questions carrying 03 marks each.
24. Section D has 02 Long Answer type questions carrying 04 marks each.
25. Section E has 03 questions carrying 04 marks each.
26. All programming questions are to be answered using Python Language only.
SECTION A
1. Which one of the following is an output device? 1
a) Keyboard (b) Mouse c) Speaker (d) Scanner
2. What is the output of the expression , 5*1**5 1
(a) 125 (b) 25 (c) 5 (d) 1
3. State True or False : List is immutable and Tuple is mutable 1
4. if L= [ ‘My Score’,95.2, 2022], which data type in Python is used? 1
a. List b. String c. Dictionary d. Tuple
5. Predict the output of the following code: 1
Var=5
if Var>4 OR VAR<6 AND Var==10:
print(“Good”)
else:
print(“Not Good”)
a. Good b . Not Good c. no output d. none
6. Which one of the following is the correct extension of the Python file? 1
(a) .py (b) .python (c) .p (d) None of these
7. MICR stands for ____________________ 1
8. Write the output of 1
print((1,3),’M’,’$’,sep=’#’,end=”%”)
9. Which of the following is/are octal number(s) ? 1
(a) 1010 (b) 234/16 (c) A2B (d) 937.45
10. What shape represents a decision in a flow chart? 1
(a)Oval (b) Diamond (c) Rectangle (d) Arrow
11. Which of the following is not valid string in Python? 1
(a) “Hello” (b) ‘Hello’ (c) “Hello’ (d) None of the Above
12. What will be the output of above Python code? 1
abc="6/4"
print("abc")
(a) 1 (b) 6/4 (c) 1.5 (d) abc
13. Which of the following is a keyword in Python language? 1
(a) if (b)for (c) int (d) all above
14. Which of following datatype not supported by python- 1
(a) float (b) Complex (c) List (D) Date

69
15. Which of these is a sequence data types? 1
(a) integer ` (b) Boolean (c) List (d) Set
16. It is a ____________ Logical Gate 1

(a) XOR (b) NAND (c) AND (d) OR


Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(i) Both A and R are true and R is the correct explanation for A
(j) Both A and R are true and R is not the correct explanation for A
(k) A is True but R is False
(l) A is false but R is True
17. Assertion (A) : Comments are non-executable statements that enable the users 1
to understand the program logic.
Reason (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 users.
18. Assertion (A) : In Python, the tuple is an immutable collection of data. 1
Reason (R) : It means that any change or alteration in data, is mentioned in
the same place. The updated collection will be use the same address for its
storage.
SECTION B
19. Rewrite the following code fragments using for loop: 2
i = 10
while (i > 0) :
print (i)
i -= 3
20. Write a for loop to print the odd number between 11 and 70. 2
OR
Write a while loop to display the multiples of 7 from 1 to 100
21. Write the Boolean expression for the following circuit 2

or
Draw the Boolean circuit for the following expression :
XYZ’+(Z'+Y')
22. What is debugging? 2
23. What is the purpose of id() in python? 2
24. Differentiate between ‘is’ operator and ‘in’ operator with 2
example.
OR
Evaluate 13+11-6*2 > 14 or “End” and “False”
25. Draw the flowchart to find the area of a rectangle. 2
or
Draw a flowchart to find the biggest of 2 numbers.

70
SECTION C
26. What is syntax error? Give example. 3
27 What is the difference between pass and break? Explain with example. 3
Or
What is the difference between // and / operator? Explain with example.
28 What is output from the following code : 3
(i)range(6) (iii)range(5,20,4) (ii)range(7,10) (iv)range (12,1,-2) (v)
range(10,2) (vi) range(-2,-6,-2)
29 Write a loop to print the following pattern : 3
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4

Or
Write a program to print the sum of digit of a number. For Ex : if number is
342 then the sum of digits is 9 (3+4+2)
30 What is an infinite loop? Give example. 3
SECTION – D
31 Explain the different data types of python with example. 4
32 Draw NAND and NOR gates with truth table for 2 variables. 4
SECTION – E
33 Write a program to check whether an year is leap or not 5
Or
Write a Python program to calculate electricity bill based on :
No. of units Rate per unit
0 to 100 - Rs. 2
101 to 300 Rs. 3
Ex : if the units is 120 the amount is 200+20 x 3=260
34 Convert the following : 5
f) 189.23(10) to binary
g) 211.A(16) to decimal
h) 79.34(8) to hexadecimal
i) 11011.1101(2) to octal
j) 457.45(8) to decimal
35 Define the following and give an example for each one of them: 5
b) Dynamic RAM b) Hardware c) Secondary Memory d) Register e) bit

 

71

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI I MID TERM – 2024-25 Time : 3 Hrs


Subject : Computer Science SET – 2 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
27. All questions are compulsory.
28. Section A have 18 questions carrying 01 mark each.
29. Section B has 07 Very Short Answer type questions carrying 02 marks each.
30. Section C has 05 Short Answer type questions carrying 03 marks each.
31. Section D has 02 Long Answer type questions carrying 04 marks each.
32. Section E has 03 questions carrying 04 marks each.
33. All programming questions are to be answered using Python Language only.
SECTION A
1. Which one of the following is not input device? 1
a) Keyboard (b) Mouse c) Speaker (d) Scanner
2. What is the output of the expression , 5*1**5 1
(a) 125 (b) 25 (c) 5 (d) 1
3. State True or False : List is immutable and Tuple is mutable 1
4. if L= [ ‘My Score’,95.2, 2022], which data type in Python is used? 1
a. List b. String c. Dictionary d. Tuple
5. Predict the output of the following code: 1
Var=5
if Var>4 OR VAR<6 AND Var==10:
print(“Good”)
else:
print(“Not Good”)
a. Good b . Not Good c. no output d. none
6. Which one of the following is the correct extension of the Python file? 1
(a) .py (b) .python (c) .p (d) None of these
7. MICR stands for ____________________ 1
8. Write the output of 1
print((1,3),’M’,’$’,sep=’#’,end=”%”)
9. Which of the following is/are octal number(s) ? 1
(a) 1010 (b) 234/16 (c) A2B (d) 937.45
10. What shape represents a decision in a flow chart? 1
(a)Oval (b) Diamond (c) Rectangle (d) Arrow
11. Which of the following is not valid string in Python? 1
(a) “Hello” (b) ‘Hello’ (c) “Hello’ (d) None of the Above
12. What will be the output of above Python code? 1
abc="6/4"
print("abc")
(a) 1 (b) 6/4 (c) 1.5 (d) abc
13. Which of the following is a keyword in Python language? 1
(a) if (b)for (c) int (d) all above
14. Which of following datatype not supported by python- 1
(a) float (b) Complex (c) List (D) Date

72
15. Which of these is a sequence data types? 1
(a) integer ` (b) Boolean (c) List (d) Set
16. It is a ____________ Logical Gate 1

(a) XOR (b) NAND (c) AND (d) OR


Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(m) Both A and R are true and R is the correct explanation for A
(n) Both A and R are true and R is not the correct explanation for A
(o) A is True but R is False
(p) A is false but R is True
17. Assertion (A) : Comments are non-executable statements that enable the users 1
to understand the program logic.
Reason (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 users.
18. Assertion (A) : In Python, the tuple is an immutable collection of data. 1
Reason (R) : It means that any change or alteration in data, is mentioned in
the same place. The updated collection will be use the same address for its
storage.
SECTION B
19. Rewrite the following code fragments using for loop: 2
i = 10
while (i > 0) :
print (i)
i -= 3
20. Write a for loop to print the odd number between 11 and 70. 2
OR
Write a while loop to display the multiples of 7 from 1 to 100
21. Write the Boolean expression for the following circuit 2

or
Draw the Boolean circuit for the following expression :
XYZ’+(Z'+Y')
22. What is debugging? 2
23. What is the purpose of id() in python? 2
24. Differentiate between ‘is’ operator and ‘in’ operator with 2
example.
OR
Evaluate 13+11-6*2 > 14 or “End” and “False”

73
25. Draw the flowchart to find the area of a rectangle. 2
or
Draw a flowchart to find the biggest of 2 numbers.
SECTION C
26. What is syntax error? Give example. 3
27 What is the difference between pass and break? Explain with example. 3
Or
What is the difference between // and / operator? Explain with example.
28 What is output from the following code : 3
(i)range(6) (iii)range(5,20,4) (ii)range(7,10) (iv)range (12,1,-2) (v)
range(10,2) (vi) range(-2,-6,-2)
29 Write a loop to print the following pattern : 3
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4

Or
Write a program to print the sum of digit of a number. For Ex : if number is
342 then the sum of digits is 9 (3+4+2)
30 What is an infinite loop? Give example. 3
SECTION – D
31 Explain tokens in python with example. 4
32 Draw XOR and XNOR gates with truth table for 2 variables. 4
SECTION – E
33 Write a program to check whether an year is leap or not 5
Or
Write a Python program to calculate electricity bill based on :
No. of units Rate per unit
0 to 100 - Rs. 2
101 to 300 Rs. 3
Ex : if the units is 120 the amount is 200+20 x 3=260
34 Convert the following : 5
a) 189.23(10) to binary
b) 211.A(16) to decimal
c) 79.34(8) to hexadecimal
d) 11011.1101(2) to octal
e) 457.45(8) to decimal
35 Define the following and give an example for each one of them: 5
g) Harddisk b) Control unit c) Static RAM d) Byte e) System bus

 

74

Vivekananda Educational Society

Std :XI Quarterly Examination – 2024-2025 Time : 3 Hrs


Subject : Computer Science SET - I Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
1. All questions are compulsory.
2. Section A have 18 questions carrying 01 mark each.
3. Section B has 07 Very Short Answer type questions carrying 02 marks each.
4. Section C has 05 Short Answer type questions carrying 03 marks each.
5. Section D has 02 Long Answer type questions carrying 04 marks each.
6. Section E has 03 questions carrying 04 marks each.
7. All programming questions are to be answered using Python Language only.
SECTION A
1. Which of the following is a keyword? 1
a) 12abc b) continue c) abc12 d) num 1
2. Which of the following is an invalid datatype in Python? 1
(a) Set (b) None (c)Integer (d)Real
3. State True or False 1
Immutable data types cannot be changed.
4. Consider the given expression: 1
not True and False or True
Which of the following will be correct output if the given expression is
evaluated?
(a) True b) False c) NONE d) NULL
5. Identify the tuple from the following : 1
a) {4:16} b) (3,4) c) [4,5] d) {6,7}
6. If the value of i is 5, the expression i != 6 1
a. has the value False
b. has the value True
c. sets the value of i to 6
d. sets the value of i to –5
7. Identify the mutable datatype from the following : 1
a) List b) integer c) complex d) tuple
8. Write the output of 1
print(“all”,”around”,”the world”,sep=’#’)
9. Which gate returns true if both inputs are similar otherwise false 1
(a) AND (b) OR (c) XOR (d) NOR
10. Which type of value is returned by the input() function. 1
a. integer b. float c. string d. no value
11. Which of these Python data structures cannot have duplicate items and does 1
not support ordering?
a) list b) tuple c) dictionary d) set
12. The statement p -= 5 has the same effect as which of these statements? 1
a) p = 5 b) p = -5 c) p = p - 5 d) p = 5 – p
13. Which statement is used for checking multiple conditions in Python? 1
a. else if b. if…elif c. switch d. None of the above

75
14. What will the output of the following expression if evaluated in Python? 1
print(15.0 / 4 + (8 + 3.0))
(a) 14.75 (b)14.0 (c) 15 (d) 15.5
15. Which symbol is used to comment a line in python? 1
c) # b) $ c) % d) @
16. In python, the term mutable means: 1
a. memory-efficient b. fixed c. changeable d. sequential
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(q) Both A and R are true and R is the correct explanation for A
(r) Both A and R are true and R is not the correct explanation for A
(s) A is True but R is False
(t) A is false but R is True
17. Assertion (A):- ** will be evaluated before / and * in an expression. 1

Reasoning (R):- The exponentiation operator in Python (**) has higher


precedence than the division (/) and multiplication (*) operators.
18. Assertion (A): == is used for comparing the values. 1
Reason (R): = is used for assigning value to a variable.
SECTION B
19. Varun has written a code to input a number and check whether it is prime 2
or not. His code is having errors. Rewrite the correct code andunderline the
corrections made.

n=int(input("Enter number to check :: ")


for i in range (2, n//2):
if n%i=0:
print("Number is not prime ")
break
else:
print("Number is prime”)
20. Write a for loop to print the even number between 13 and 50. 2
OR
Write a while loop to display the multiples of 6 from 1 to 100
21. Write the Boolean expression for the following circuit 2

or
Draw the Boolean circuit for the following expression :
A.B.C+(B'+C').A
22. Write the symbol of 8 assignment operators and its meaning. 2
23. What is the default return type of input() and how can it be changed? 2

76
24. List the rules of naming the identifiers. 2
OR
Write the logical expression corresponding to the following statement in
python:
e) The sum of 20 and -10 is less than 12
f) Remainder of 14 divided by 3 is equal to 2

25. Predict the output of the Python code given below: 2


X=range(1,10,2)
for i in X:
print(i)
(b)
X,Y=17,4
print (X//Y)
print(X/Y)
or
i=1
while i < 6:
print(i)
if i == 3:
break
i += 1

SECTION C
26. Explain logical operators in python with example. 3
27 What is the difference between break and continue? 3
Or
What is the difference between else and elif construct in if statement?
28 h) What is repetition operator? Give example. 3
i) What is membership operator? Give example.
j) What is identity operator? Give example.
29 What is the use of range() function? Explain the purpose of each parameter? 3
30 Differentiate between break and continue statements with example. 3
SECTION – D
31 What is meant by looping structure? Give example of looping structures in 4
python.
32 Prove the following using truth table : 4
a) X+YZ=(X+Y).(X+Z) b) A+A’B=A+B
SECTION – E
33 Write a program to convert a number entered by the user into its 5
corresponding number in words. For example, if the input is 876 then the
output should be ‘Eight Seven Six’.
Or
Write a Python program to calculate bonus as the following criteria using if-
elif statement :
If salary between bonus
0 to 25000 - 25% of salary
25001 to 35000 - 15% of salary
35001 to 50000 - 10% of salary
50001 to 75000 - 05 % of salary

77
75001 and above nil

34 Convert the following : 5


k) 427.56(10) to binary
l) C47.15(16) to decimal
m) 573.64(8) to decimal
n) 11101.101a(2) to decimal
o) 723.47(8) to binary
35 Define the following and give an example for each one of them: 5
k) Assembler b) Interpreter c) System software
l) Software e) Disk Defragmentor

Vivekananda Educational Society

Std :XI Quarterly Examination – 2024-2025 Time : 3 Hrs


Subject : Computer Science SET - II Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E.
1. All questions are compulsory.
2. Section A have 18 questions carrying 01 mark each.
3. Section B has 07 Very Short Answer type questions carrying 02 marks each.
4. Section C has 05 Short Answer type questions carrying 03 marks each.
5. Section D has 02 Long Answer type questions carrying 04 marks each.
6. Section E has 03 questions carrying 04 marks each.
7. All programming questions are to be answered using Python Language only.
SECTION A
1. Which of the following is a valid identifier? 1
b) 12abc b) continue c) abc12 d) num 1
2. Which of the following is an invalid datatype in Python? 1
(a) Set (b) None (c)Integer (d)Real
3. State True or False 1
Immutable data types cannot be changed.
4. Consider the given expression: 1
not True and False or True
Which of the following will be correct output if the given expression is
evaluated?
(b) True b) False c) NONE d) NULL
5. Identify the tuple from the following : 1
a) {4:16} b) (3,4) c) [4,5] d) {6,7}
6. If the value of i is 5, the expression i != 6 1
a. has the value False
b. has the value True
c. sets the value of i to 6
d. sets the value of i to –5
7. Identify the mutable datatype from the following : 1
a) List b) integer c) complex d) tuple
8. Write the output of 1
print(“all”,”around”,”the world”,sep=’#’)

78
9. Which gate returns true if both inputs are similar otherwise false 1
(a) AND (b) OR (c) XOR (d) NOR
10. Which type of value is returned by the input() function. 1
a. integer b. float c. string d. no value
11. Which of these Python data structures cannot have duplicate items and does 1
not support ordering?
a) list b) tuple c) dictionary d) set
12. The statement p -= 5 has the same effect as which of these statements? 1
a) p = 5 b) p = -5 c) p = p - 5 d) p = 5 – p
13. Which statement is used for checking multiple conditions in Python? 1
a. else if b. if…elif c. switch d. None of the above
14. What will the output of the following expression if evaluated in Python? 1
print(15.0 / 4 + (8 + 3.0))
(a) 14.75 (b)14.0 (c) 15 (d) 15.5
15. Which symbol is used to comment a line in python? 1
d) # b) $ c) % d) @
16. In python, the term mutable means: 1
a. memory-efficient b. fixed c. changeable d. sequential
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(u) Both A and R are true and R is the correct explanation for A
(v) Both A and R are true and R is not the correct explanation for A
(w) A is True but R is False
(x) A is false but R is True
17. Assertion (A):- ** will be evaluated before / and * in an expression. 1

Reasoning (R):- The exponentiation operator in Python (**) has higher


precedence than the division (/) and multiplication (*) operators.
18. Assertion (A): == is used for comparing the values. 1
Reason (R): = is used for assigning value to a variable.
SECTION B
19. Varun has written a code to input a number and check whether it is prime 2
or not. His code is having errors. Rewrite the correct code andunderline the
corrections made.

n=int(input("Enter number to check :: ")


for i in range (2, n//2):
if n%i=0:
print("Number is not prime ")
break
else:
print("Number is prime”)
20. Write a for loop to print the even number between 13 and 50. 2
OR
Write a while loop to display the multiples of 6 from 1 to 100

79
21. Write the Boolean expression for the following circuit 2

or
Draw the Boolean circuit for the following expression :
A.B.C+(B'+C').A
22. Write the symbol of 6 relational operators and its meaning. 2
23. What is the default return type of input() and how can it be changed? 2
24 List the rules of naming the identifiers. 2
OR
Write the logical expression corresponding to the following statement in
python:
a) The sum of 20 and -10 is less than 12
b) Remainder of 14 divided by 3 is equal to 2
25. Predict the output of the Python code given below: 2
a)
X=range(1,10,2)
for i in X:
print(i)

(b)
X,Y=17,4
print (X//Y)
print(X/Y)
or
i=1
while i < 6:
print(i)
if i == 3:
break
i += 1

SECTION C
26. Explain logical operators in python with example. 3
27 What is the difference between break and continue? 3
Or
What is the difference between else and elif construct in ‘if’ statement?
28 k) What is repetition operator? Give example. 3
l) What is membership operator? Give example.
m) What is identity operator? Give example.
29 What is the use of range() function? Explain the purpose of each parameter. 3
Or
What is meant by looping structure? Give example of looping structure in
python.
30 Differentiate between break and continue statements with example. 3
SECTION – D

80
31 Explain syntax error, runtime error and logical error with example. 4
32 State and verify Demorgans theorem using truth table. 4
SECTION – E
33 Write a program to convert a number entered by the user into its 5
corresponding number in words. For example, if the input is 876 then the
output should be ‘Eight Seven Six’.
Or
Write a Python program to calculate bonus as the following criteria using if-
elif statement :
If salary between bonus
0 to 25000 - 25% of salary
25001 to 35000 - 15% of salary
35001 to 50000 - 10% of salary
50001 to 75000 - 05 % of salary
75001 and above nil
34 Convert the following : 5
p) 342.24(10) to binary
q) A21.13(16) to decimal
r) 674.34(8) to decimal
s) 11011.1101(2) to decimal
t) 457.45(8) to binary
35 Define the following and give an example for each one of them: 5
c) Operating system b) Packages c) Utilities
n) Application Software e) Language processors

 

81


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI CYCLE TEST (JULY) – 2024-25 Time : 2 periods


Subject : Computer Science Python Basics Max. Marks:25
I. Answer the following : (7x3=21)
1. List the symbols of allw mathematical operators with the purpose.
2. List the symbols of all relational operators and its meaning.
3. List the symbols of all assignment operators with its purpose.
4. List the symbols of all logical operators and its meaning.
5. Identify the data of the following variable :
S=[11,22,33] M=”Good Day” F=(14,15,”Well”)
P=3+4j G=15567 T=2.765
6. Evaluate the following expression :
i) -15 and 0 or 24 ii) 34+16 – 27 < 12 or False iii) “abc” and 15+3 or 19
7. Write the output of the following code :
a=35
b=’vivek’
print(a, “ and “, b, “ = “, a+b, “mathematical operator +”)
print(a<b,a>b,a==b)
#print(“this’s is a good practice”)



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI CYCLE TEST (JULY) – 2023-24 Time : 2 periods


Subject : Computer Science Python Basics Max. Marks:25
I. Answer the following : (7x3=21)
1. List the symbols of all mathematical operators with the purpose.
2. List the symbols of all relational operators and its meaning.
3. List the symbols of all assignment operators with its purpose.
4. List the symbols of all logical operators and its meaning.
5. Identify the data of the following variable :
S=[11,22,33] M=”Good Day” F=(14,15,”Well”)
P=3+4j G=15567 T=2.765
6. Evaluate the following expression :
i) -15 and 0 or 24 ii) 34+16 – 27 < 12 or False iii) “abc” and 15+3 or 19
7. Write the output of the following code :
a=35
b=’vivek’
print(a, “ and “, b, “ = “, a+b, “mathematical operator +”)
print(a<b,a>b,a==b)
#print(“this’s is a good practice”)

82
II. Write python program for the following : (4)

To accept length, breadth and height of a cuboid and print its volume (lxbxh) and Total
Surface area 2 (lb+bh+lh). (4)

II. Write python program for the following : (4)

To accept length, breadth and height of a cuboid and print its volume (lxbxh) and Total
Surface area 2 (lb+bh+lh). (4)

83
SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39
Text and CSV File handling – 2024-2025 (July )
Class : XII Subject : Computer Science
Answer the following questions (4x3=12)
1. Write a function in Python that displays the book names having y in their name
from a text file Bookname.txt
Example : If the file Bookname.txt contains the names of following books :
One Hundred Years of Solitude
The Diary of a Young Girl
On the Road
After execution, the output will be :
One Hundred Years of Solitude
The Diary of a Young Girl

2. Write a function RevString() to read the textfile ‘Input.txt’ and prints the words
starting with ‘O’ in the reverse order. The rest of the content is displayed normally.
Example :
If content in the text file is :
UBUNTU IS AN OPEN SOURCE OPERATING SYSTEM
Output will be :
UBUNTU IS AN NEPO SOURCE GNITAREPO SYSTEM
(the words OPEN and OPERATING are displayed in reverse order)

3. Write a function, vowelCount() in Python that counts and displays the number of
vowels in the text file named Poem.txt.

------------------------------------------------------------------------------------------------------------------

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Text and CSV File handling – 2024-2025 (July )
Class : XII Subject : Computer Science
Answer the following questions (4x3=12)
1. Write a function in Python that displays the book names having y in their name
from a text file Bookname.txt
Example : If the file Bookname.txt contains the names of following books :
One Hundred Years of Solitude
The Diary of a Young Girl
On the Road
After execution, the output will be :
One Hundred Years of Solitude
The Diary of a Young Girl

2. Write a function RevString() to read the textfile ‘Input.txt’ and prints the words
starting with ‘O’ in the reverse order. The rest of the content is displayed normally.
Example :

84
If content in the text file is :
UBUNTU IS AN OPEN SOURCE OPERATING SYSTEM
Output will be :
UBUNTU IS AN NEPO SOURCE GNITAREPO SYSTEM
(the words OPEN and OPERATING are displayed in reverse order)

3. Write a function, vowelCount() in Python that counts and displays the number of
vowels in the text file named Poem.txt.

4. Write a function biglines() in Python to read a text file, Alpha.txt and displays those
lines which have more then 5 words in it.

5. Vedansh is a Python programmer working in a school. For the Annual Sports


Event, he has created a csv file named Result.csv, to store the results of students in
different sports events. The structure of Result.csv is : [St_Id, St_Name,
Game_Name, Result] Where St_Id is Student ID (integer), ST_name is Student
Name (string), Game_Name is name of game in which student is participating(string)
Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'
For efficiently maintaining data of the event, Vedansh wants to write the following
user defined functions:
Accept() – to accept a record from the user and add it to the file Result.csv. The
column headings should also be added on top of the csv file.
wonCount() – to count the number of students who have won any event. As a Python
expert, help him complete the task. (3+3)

6. What is the use of tell() function? (1+3+3)


Write a program in Python that defines and calls the following user defined functions:
Add(): to add the record of a student to a csv file “record.csv”. Each record should be
with field elements [admno,sname,class]
Count(): to count the number of students studying in class 12

4. Write a function biglines() in Python to read a text file, Alpha.txt and displays those
lines which have more then 5 words in it.

5. Vedansh is a Python programmer working in a school. For the Annual Sports


Event, he has created a csv file named Result.csv, to store the results of students in
different sports events. The structure of Result.csv is : [St_Id, St_Name,
Game_Name, Result] Where St_Id is Student ID (integer), ST_name is Student
Name (string), Game_Name is name of game in which student is participating(string)
Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'
For efficiently maintaining data of the event, Vedansh wants to write the following
user defined functions:

85
Accept() – to accept a record from the user and add it to the file Result.csv. The
column headings should also be added on top of the csv file.
wonCount() – to count the number of students who have won any event. As a Python
expert, help him complete the task. (3+3)

6. What is the use of tell() function? (1+3+3)


Write a program in Python that defines and calls the following user defined functions:
Add(): to add the record of a student to a csv file “record.csv”. Each record should be
with field elements [admno,sname,class]
Count(): to count the number of students studying in class 12

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Exception Handling & Functions – 2024-2025 (June )
Class : XII Subject : Computer Science
Answer the following questions (7x3=21)

1. Write a code to catch the ZeroDivisionError and display appropriate message. (3)
2. What is the output of the following Code : (3)

3. Write a function INDEX_LIST(L), where L is the list of elements passed as


argument to the function. The function returns another list named ‘indexList’ that
stores the indices of all Non-Zero Elements of L. (3)
For example: If L contains [12,4,0,11,0,56] The indexList will have - [0,1,3,5]
4. Write a function, lenWords(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
"Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3)

------------------------------------------------------------------------------------------------------------------

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Exception Handling & Functions – 2024-2025 (June )
Class : XII Subject : Computer Science

Answer the following questions (7x3=21)

1. Write a code to catch the ZeroDivisionError and display appropriate message. (3)
2. What is the output of the following Code :

86
3. Write a function INDEX_LIST(L), where L is the list of elements passed as
argument to the function. The function returns another list named ‘indexList’ that
stores the indices of all Non-Zero Elements of L.
For example: If L contains [12,4,0,11,0,56] The indexList will have - [0,1,3,5]
4. Write a function, lenWords(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
"Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3)

87
5. Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES
as an argument and displays the names (in uppercase)of the places whose names
are longer than 5 characters. For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be: LONDON NEW YORK
6. Write a Python program that prompts the user to input an integer and raises a
ValueError exception if the input is not a valid integer.
7. Write a Python program that prompts the user to input age and raises an
AssertionError exception if the input is not a valid age. Note : valid age is between 1
to 100
8. Given the following code : (4)
try:
print(a//b)
except ZeroDivisionError:
print('Cannot be divided')
except:
print('Check input')
else:
print('Bugs are not common')
finally:
print('python')
Predict the output for the following input values
i) a=10, b=5 iii) a=6, b=0
ii) a='start', b=2 iv) a=’good’, b=’end'

------------------------------------------------------------------------------------------------------------------

5. Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES


as an argument and displays the names (in uppercase)of the places whose names
are longer than 5 characters. For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be: LONDON NEW YORK
6. Write a Python program that prompts the user to input an integer and raises a
ValueError exception if the input is not a valid integer.
7. Write a Python program that prompts the user to input age and raises an
AssertionError exception if the input is not a valid age. Note : valid age is between 1
to 100
8. Given the following code : (4)
try:
print(a//b)
except ZeroDivisionError:
print('Cannot be divided')
except:
print('Check input')
else:
print('Bugs are not common')
finally:
print('python')
Predict the output for the following input values
i) a=10, b=5 ii) a='start', b=2

88
iii) a=6, b=0 iv) a=’good’, b=’end'

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Data Representation – 2024-2025 (June )
Class : XI Subject : Computer Science

1. List the digits of decimal, binary, octal and hexadecimal numbers. (3)

2. Convert the following : (11 x 2 = 22)


a) 143.23(10) to Binary g) AC2.D3(16) to binary
b) 347.35(10) to Octal h) 356.24(8) to binary
c) 1585.42(10) to hexadecimal i) 1101010.1101(2) to octal
d) 111011.1101(2) to decimal j) 1101011010.111101(2) to
e) 346.562(8) to decimal hexadecimal
f) A2B7.E2(16) to decimal k) 336457.2314(8) to hexadecimal

------------------------------------------------------------------------------------------------------------------

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Data Representation – 2024-2025 (June )
Class : XI Subject : Computer Science

1. List the digits of decimal, binary, octal and hexadecimal numbers. (3)

2. Convert the following : (11 x 2 = 22)


a) 143.23(10) to Binary g) AC2.D3(16) to binary
b) 347.35(10) to Octal h) 356.24(8) to binary
c) 1585.42(10) to hexadecimal i) 1101010.1101(2) to octal
d) 111011.1101(2) to decimal j) 1101011010.111101(2) to hexadecimal
e) 346.562(8) to decimal k) 336457.2314(8) to hexadecimal
f) A2B7.E2(16) to decimal

------------------------------------------------------------------------------------------------------------------

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Data Representation – 2024-2025 (June )
Class : XI Subject : Computer Science

1. List the digits of decimal, binary, octal and hexadecimal numbers. (3)

2. Convert the following : (11 x 2 = 22)


a) 143.23(10) to Binary g) AC2.D3(16) to binary
b) 347.35(10) to Octal h) 356.24(8) to binary
c) 1585.42(10) to hexadecimal i) 1101010.1101(2) to octal
d) 111011.1101(2) to decimal j) 1101011010.111101(2) to hexadecimal
e) 346.562(8) to decimal k) 336457.2314(8) to hexadecimal
f) A2B7.E2(16) to decimal
89
90
SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39
Strings – 2023-2024
Write the output of the following statements:
m="Computer Science of class 12 - python"
1. print(m[-8:-1]) 7. print(m[5::2]) 13. print(m.find('e',10,25))
2. print(m[::2]) 8. print(m[-15:-2:-1]) 14. print(m.index('d',4,40))
3. print(m[9]) 9. print(m.capitalize()) 15. print(m.count('c'))
4. print(m[-32]) 10. print('*'.join(m[5:10])) 16. print(m[2:10][1:3])
5. print(m[:-3:]) 11. print(len(m.split('e'))) 17. print(m.isalnum())
6. print(m[2:16:2][3]) 12. print(m.strip('Conm'))
1.Write a python code to print the number of digits in a string.
2. Accept and string and create a list of all unique characters in it.
Ex: if the string is "Computer Science 12"
the list must be ['C', 'o', 'm', 'p', 'u', 't', 'e', 'r', ' ', 'S', 'c', 'i', 'n', '1', '2']

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Strings – 2023-2024
Write the output of the following statements:
m="Computer Science of class 12 - python"
1. print(m[-8:-1]) 7. print(m[5::2]) 13. print(m.find('e',10,25))
2. print(m[::2]) 8. print(m[-15:-2:-1]) 14. print(m.index('d',4,40))
3. print(m[9]) 9. print(m.capitalize()) 15. print(m.count('c'))
4. print(m[-32]) 10. print('*'.join(m[5:10])) 16. print(m[2:10][1:3])
5. print(m[:-3:]) 11. print(len(m.split('e'))) 17. print(m.isalnum())
6. print(m[2:16:2][3]) 12. print(m.strip('Conm'))
1.Write a python code to print the number of digits in a string.
2. Accept and string and create a list of all unique characters in it.
Ex: if the string is "Computer Science 12"
the list must be ['C', 'o', 'm', 'p', 'u', 't', 'e', 'r', ' ', 'S', 'c', 'i', 'n', '1', '2']

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI – 39


Strings – 2023-2024
Write the output of the following statements:
m="Computer Science of class 12 - python"
1. print(m[-8:-1]) 7. print(m[5::2]) 13. print(m.find('e',10,25))
2. print(m[::2]) 8. print(m[-15:-2:-1]) 14. print(m.index('d',4,40))
3. print(m[9]) 9. print(m.capitalize()) 15. print(m.count('c'))
4. print(m[-32]) 10. print('*'.join(m[5:10])) 16. print(m[2:10][1:3])
5. print(m[:-3:]) 11. print(len(m.split('e'))) 17. print(m.isalnum())
6. print(m[2:16:2][3]) 12. print(m.strip('Conm'))
1.Write a python code to print the number of digits in a string.
2. Accept and string and create a list of all unique characters in it.
Ex: if the string is "Computer Science 12"

91
the list must be ['C', 'o', 'm', 'p', 'u', 't', 'e', 'r', ' ', 'S', 'c', 'i', 'n', '1', '2']



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI PRE-ANNUAL EXAM – 2023-24 Time : 3 Hrs


Subject : Computer Science SET - 2 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.
Section A
1. What is meant by Passive Digital footprint?
2. Name the Python Library modules which need to be imported to invoke the following
functions : (i) sqrt() (ii) mean()
3. Which of the following is not a valid variable name in Python ?
Justify reason for it not being a valid name. (i) Radius5 (ii) Radius_ (iii) _Radius (iv) $Radius
4. Which of the following are keywords in Python ?
(i) exit (ii) for (iii) number (iv) While
5. Write a Python statement to declare a Dictionary named Ticket with Keys as 101, 102, 103
and corresponding values as 'Madhu', ‘Veena', 'Deepa' respectively.
6. Write the output of the following Python code :
for i in range(2,7,2):
print(i,‘*’,'$')
7. Given the following dictionary
Day={1:"Monday", 2: "Tuesday", 3: "Wednesday"} Which statement will return "Wednesday".
(a) Day.pop(3) (b) Day.pop(2) (c) Day.pop(1) (d) Day.pop("Tuesday")
8. Draw the Boolean circuit for the expression : (𝑋 + 𝑌𝑍) + 𝐴𝐵
9. Expand GUI, ALU
10. Write the order of precedence of arithmetic operators.
11. What is the difference between * and **.
12. Which of the following is a immutable datatype in Python ?
(a) Dictionary (b) String (c) List (d) Tuple
13. Select the correct output of the code :
S="Amrit Mahotsav @ 75"
A=S.partition(" ",2)
print(A)
(a) ('Amrit', ' ' ,’Mahotsav @ 75') (b) ['Amrit', 'Mahotsav', '@ 75']
(c) ['Amrit', ' ' ,’Mahotsav @ 75'] (d) ['Amrit', 'Mahotsav', '@', '75']
14. Given is a Python string declaration :
NAME = "Learning Python is Fun"
Write the output of : print(NAME[-5:-12:-2])
15. What are modules in python?
16. Give an example of logical error.
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): List is a mutable data type
Reasoning (R): When an attempt is made to update the value of an mutable variable, are done
in the same memory location.
18. Assertion(A): Python Standard Library consists of various modules.
Reasoning(R): A function in a module can be invoked upon importing the module.

Section B (7x2=14)

19. Write loop structure to generate the following pattern upto ‘n’ value :
1
12
123
1234

20. Give one example for the following :


a) Utility SW
b) FOSS
c) General Purpose Software –
d) Freeware

21. From the options given below find the possible outputs(s) that will be displayed on screen
at the time of execution of the program from the following code? Also specify the maximum
values that can be assigned to each of the variables Lower and Upper.
import random
AR=[20,30,40,50,60,70]
Lower =random.randint(1,3)
Upper =random.randint(2,4)
for K in range(Lower, Upper +1):
print (AR[K],end=”#“)
(i) 10#40#70# (ii) 30#40#50# (iii) 50#60#70# (iv) 40#50#70#

22. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop / period or not.
23. Draw a flowchart to accept 3 numbers and print biggest and smallest among the 3.

24. Rewrite the following code after removing the errors, underline each correction :

25. Evaluate the following statement:


a) 16 - (4 + 2) * 5 + 2**3 * 4 b) 45 and -16<-14 or 65 and not [3,4]

Section C (5x3=15)
26. Predict the output of the code given below :
Krrishnav is looking for his dream job but has some restrictions. He loves Delhi and would take
a job there if he is paid over Rs.40,000 a month. He hates Chennai and demands at least Rs.
1,00,000 to work there. In any another location he is willing to work for Rs. 60,000 a month.
The following code shows his basic strategy for evaluating a job offer.
Code:
pay= _________
location= _________
if location == "Mumbai":
print ("I’ll take it!") #Statement 1
elif location == "Chennai":
if pay < 100000:
print ("No way") #Statement 2
else:
print("I am willing!") #Statement 3
elif location == "Delhi" and pay > 40000:
print("I am happy to join") #Statement 4
elif pay > 60000:
print("I accept the offer") #Statement 5
else:
print("No thanks, I can find something better")#Statement 6

On the basis of the above code, write the output when different inputs for pay and location are
given.
a) Input: location = "Chennai”, pay = 50000
b) Input: location = "Surat" ,pay = 50000
c) Input location = "Delhi", pay = 500000

27. State and verify Demorgans law using Truth Table.

28. Explain gender and disability issues with teaching and using computers.
29. Mention any 3 ways of proper disposal of used electronic gadgets.

30. How are interpreters, compilers and assemblers different from each other?

Section D (2x4=8)
31.Define the following terms :
a) Malware b) Ransomware c) Trojan horse d) eavesdropping

32. Write a code to create a list of numbers . Accept a number and display the position of the
number in the list along with its number of occurrences. Eg: if the list contains
[2,12,3,4,5,6,2,4,2] then output must be
Enter number to search :2
Number 2 is found at position 1, 8 and 9
2 is found 3 times in the list.

Section E (3x5=15)
33.Convert the following numbers :
a) 165.32(8) to decimal
b) A2C.47(16) to octal
c) 101010.101(2) to decimal

34. Write a python code to create a dictionary of team name the wins and losses, get the input
from the user. Team namwe is the key and wins and losses is the value Eg :
{‘csk’:(5,4),’rcb’:(6,4)}. Using the dictionary perform the following:
a) Get the team name from the user and display the wins, losses and total number of matches
b) Display the teams which has more wins than losses.
Or
Write a python code to accept a string and create a tuple with number of characters of each
word. Eg: If the string is “Make hay when the sunshines.”, the tuple created must be (4,3,4,3,10).
Display the biggest word in the string.

35. Write a python code to accept the salary from the user and expenditure under various heads
like grocery, entertainment and house rent. Find the balance amount left after all expenditure, if
the amount is
>= 10,000 – display ‘you can buy an car in loan’
>20,000 – display ‘ you can buy a house in loan’
>40,000 – display ‘ you can buy both car and house on loan’
<10,000 - display ‘earn more or save more for future plans’ 


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI PRE-ANNUAL EXAM – 2023-24 Time : 3 Hrs


Subject : Computer Science SET-1 Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
9. Please check this question paper contains 35 questions.
10. The paper is divided into 4 Sections- A, B, C, D and E.
11. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
12. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
13. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
14. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
15. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
16. All programming questions are to be answered using Python Language only.
Section A
1. What is meant by Digital footprint?
2. Name the Python Library modules which need to be imported to invoke the following
functions :
(i) cos() (ii) randint()
3. Which of the following is not a valid variable name in Python ?
Justify reason for it not being a valid name. (i) 5Radius (ii) Radius_ (iii) _Radius (iv) Radius
4. Which of the following are keywords in Python ?
(i) break (ii) check (iii) range (iv) while
5. Write a Python statement to declare a Dictionary named ClassRoll with Keys as 1, 2, 3 and
corresponding values as 'Reena', 'Rakesh', 'Zareen' respectively.
6. Write the output of the following Python code :
for i in range(2,7,2):
print(i * '$')
7. Given the following dictionary
Day={1:"Monday", 2: "Tuesday", 3: "Wednesday"} Which statement will return "Tuesday".
(b) Day.pop() (b) Day.pop(2) (c) Day.pop(1) (d) Day.pop("Tuesday")
8. Draw the Boolean circuit for the expression : (𝑋 + 𝑌) + 𝐶𝐷
9. Expand GPL, FOSS
10. Write the order of precedence of logical operators.
11. What is the difference between = and ==.
12. Which of the following is not a sequential datatype in Python ?
(a) Dictionary (b) String (c) List (d) Tuple
13. Select the correct output of the code :
S="Amrit Mahotsav @ 75"
A=S.split(" ",2)
print(A)
(a) ('Amrit', 'Mahotsav', '@', '75') (b) ['Amrit', 'Mahotsav', '@ 75']
(c) ('Amrit', 'Mahotsav', '@ 75') (d) ['Amrit', 'Mahotsav', '@', '75']
14. Given is a Python string declaration :
NAME = "Learning Python is Fun"
Write the output of : print(NAME[-5:-10:-1])
15. How are comments inserted in python code?
16. What is the concept of l-value and r-value?
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
e) Both A and R are true and R is the correct explanation for A
f) Both A and R are true and R is not the correct explanation for A
g) A is True but R is False
h) A is false but R is True
17. Assertion(A): List is an immutable data type Reasoning
(R): When an attempt is made to update the value of an immutable variable, the old variable is
destroyed and a new variable is created by the same name in memory.
18. Assertion(A): Python Standard Library consists of various modules.
Reasoning(R): A function in a module is used to simplify the code and avoids repetition.

Section B (7x2=14)

19. Write loop structure to generate the following pattern upto ‘n’ value :
1
22
333
4444

20. Give one example for the following :


e) Utility SW
f) FOSS
g) General Purpose Software –
h) Freeware

21. From the options given below find the possible outputs(s) that will be displayed on screen
at the time of execution of the program from the following code? Also specify the maximum
values that can be assigned to each of the variables Lower and Upper.
import random
AR=[20,30,40,50,60,70]
Lower =random.randint(1,3)
Upper =random.randint(2,4)
for K in range(Lower, Upper +1):
print (AR[K],end=”#“)
(i) 10#40#70# (ii) 30#40#50# (iii) 50#60#70# (iv) 40#50#70#

22. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop / period or not.

23. Draw a flowchart to accept 3 numbers and print biggest and smallest among the 3.
24. Rewrite the following code after removing the errors, underline each correction :

25. Evaluate the following statement:


a) 16 - (4 + 2) * 5 + 2**3 * 4 b) 45 and -16<-14 or 65 and not [3,4]

Section C (5x3=15)
26. Predict the output of the code given below :
Krrishnav is looking for his dream job but has some restrictions. He loves Delhi and would take
a job there if he is paid over Rs.40,000 a month. He hates Chennai and demands at least Rs.
1,00,000 to work there. In any another location he is willing to work for Rs. 60,000 a month.
The following code shows his basic strategy for evaluating a job offer.
Code:
pay= _________
location= _________
if location == "Mumbai":
print ("I’ll take it!") #Statement 1
elif location == "Chennai":
if pay < 100000:
print ("No way") #Statement 2
else:
print("I am willing!") #Statement 3
elif location == "Delhi" and pay > 40000:
print("I am happy to join") #Statement 4
elif pay > 60000:
print("I accept the offer") #Statement 5
else:
print("No thanks, I can find something better")#Statement 6

On the basis of the above code, write the output when different inputs for pay and location are
given.
d) Input: location = "Chennai”, pay = 50000
e) Input: location = "Surat" ,pay = 50000
f) Input location = "Delhi", pay = 500000

27. State and verify Demorgans law using Truth Table.

28. Explain gender and disability issues with teaching and using computers.

29. Mention any 3 ways of proper disposal of used electronic gadgets.


30. How are interpreters, compilers and assemblers different from each other?

Section D (2x4=8)
31.Define the following terms :
a) Malware b) Ransomware c) Trojan horse d) eavesdropping

32. Write a code to create a list of numbers . Accept a number and display the position of the
number in the list along with its number of occurrences. Eg: if the list contains
[2,12,3,4,5,6,2,4,2] then output must be
Enter number to search :2
Number 2 is found at position 1, 8 and 9
2 is found 3 times in the list.

Section E (3x5=15)
33.Convert the following numbers :
d) 165.32(8) to decimal
e) A2C.47(16) to octal
f) 101010.101(2) to decimal

34. Write a python code to create a dictionary of team name the wins and losses, get the input
from the user. Team namwe is the key and wins and losses is the value Eg :
{‘csk’:(5,4),’rcb’:(6,4)}. Using the dictionary perform the following:
a) Get the team name from the user and display the wins, losses and total number of matches
b) Display the teams which has more wins than losses.
Or
Write a python code to accept a string and create a tuple with number of characters of each
word. Eg: If the string is “Make hay when the sunshines.”, the tuple created must be (4,3,4,3,10).
Display the biggest word in the string.

35. Write a python code to accept the salary from the user and expenditure under various heads
like grocery, entertainment and house rent. Find the balance amount left after all expenditure, if
the amount is
>= 10,000 – display ‘you can buy an car in loan’
>20,000 – display ‘ you can buy a house in loan’
>40,000 – display ‘ you can buy both car and house on loan’
<10,000 - display ‘earn more or save more for future plans’ 
SMT. NDJA Vivekananda Vidyalaya Sr. Sec School, Ch – 39

Cycle Test – 2023-2024 (JANUARY) – Tuple and Dictionary

Subject : COMPUTER Science Std : XI


Marks : 25
Answer the following questions (5 x 3 =15)
1. Declare a tuple with only one element 5.
2. List any 3 functions of tuple.
3. Declare a dictionary with colour as key and number of characters as values (eg:
‘blue’ is the key and 4 is the value) for any 3 colours.
4. What is meant by tuple unpacking? Give example.
5. Write the output for the following :
t1=(78,99,11)
t2=(10,20)
t3=t1+t2*2
t4=t3+t2
print((t1+t2)*2)
print(t3)
print(t4)
6. Consider the following dictionary stateCapital: (6)
stateCapital =
{"AndhraPradesh":"Hyderabad","Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}
Find the output of the following statements:
1. print(stateCapital.get("Bihar"))
2. print(stateCapital.keys())
3. print(stateCapital.values())
4. print(stateCapital.items())
5. print(len(stateCapital))
6. print("Maharashtra" in stateCapital)

SMT. NDJA Vivekananda Vidyalaya Sr. Sec School, Ch – 39

Cycle Test – 2022-2023 (OCTOBER II) – Strings and Functions

Subject : COMPUTER Science Std : XI


Marks : 25

1. What is a string ? Declare a string and assign the value “God is Great”.
2. Write a function deleteChar() which takes two parameters one is a string and other is
a character. The function should create a new string after deleting all occurrences of
the character from the string and return the new string.
3. Explain the following string in-built functions ;
Count(), find(), index()
4. Explain String slicing with example for all parameters.
5. What is a function? List the different types of functions.
6. What is a module? What are the different ways in which a module can be imported?
7. Differentiate between local and global variable.
8. Consider the following string mySubject: (4)

mySubject = "Computer Science"

What will be the output of the following string operations :

i. print(mySubject[-7:-1])
ii. print(mySubject[::2])
iii. print(mySubject[len(mySubject)-1])
iv. print(2*mySubject)
v. print(mySubject[::-2])
vi. print(mySubject[:3] + mySubject[3:])
vii. print(mySubject.startswith('Comp'))
viii. print(mySubject.isalpha())

8. Consider the following string mySubject: (4)

mySubject = "Computer Science"

What will be the output of the following string operations :

i. print(mySubject[-7:-1])
ii. print(mySubject[::2])
iii. print(mySubject[len(mySubject)-1])
iv. print(2*mySubject)
v. print(mySubject[::-2])
vi. print(mySubject[:3] + mySubject[3:])
vii. print(mySubject.startswith('Comp'))
viii. print(mySubject.isalpha())



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII II MID TERM – 2023-24 Time : 3 Hrs


Subject : Computer Science Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
9. Please check this question paper contains 35 questions.
10. The paper is divided into 4 Sections- A, B, C, D and E.
11. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
12. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
13. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
14. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
15. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
16. All programming questions are to be answered using Python Language only.
Section A
1 Write full form of CSV. 1
2 Which is valid keyword? 1
c. Int b.WHILE c.While d.if
3 Which of the following is not a valid identifier name in Python? 1
a) 5Total b)_Radius c) pie d)While
4 Consider the following expression: 51+4-3**3//19-3 1
Which of the following will be the correct output if the expression is evaluated?
c. 50 b) 51 c) 52 d) 53
5 Select the correct output of the 1
code: Str=“Computer”
Str=Str[-4:]
print(Str*2)
c. Returetu b) uterretu c) uteruter d) None of these
6 Which module is imported for working with CSV files in Python? 1
c. csv b) python-csv connector c) CSV d) python.csvconnector
7 Fill in the blank: 1
Command is used to modify records in the MySQL table.
(a)ALTER (b) UPDATE (c) MODIFY (d) SELECT
8 Which command is used to retrieve the output of the query in python? 1
(a)BRING (b)FETCH (c)GET (d) SELECT
9 Which of the following statement(s) would give an error after executing the following 1
code?
print(9/2) #Statement-1
print(9//2) #Statement-2
print(9%%2) #Statement-3
print(9%2) #Statement-4
(a)Statement-1 (b)Statement-2 (c)Statement-3 (d)Statement-4
10 Fill in the blanks: 1
is the table constraint used to stop null values to be entered in the field.
(iii) Unique ii) Not NULL iii) Not Empty iv) None
11 The correct syntax of read() function from text files is: 1
c. file_object.read() b) file_object(read) c) read(file_object) d) file_object().read
12 Fill in the blank: 1
In SQL, we use command to display the list of databases in the server.
(c) SELECT DATABASES; b) SELECT DATABASE; c) SHOW DATABASES; d) DESC;
13 Fill in the blank: 1
clause is used in the SQL query to display the data in ascending order.
(c) DESC (b)ORDER BY (c)GROUP BY (d)UPDATE
14 What will the output following expression when evaluated in Python? 1
10*1*2**4-4//4
15 Which function is used to display the maximum of records from table in a database? 1
(a)MAX (b)MAXIMUM (c)LARGEST (d) GREAT
16 To establish a connection with MySQL from Python which of the following functions is 1
used?
(a)connection() (b) connect() (c) open() (d) cursor()
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice
as:
(g) Both A and R are true and R is the correct explanation for A
(h) Both A and R are true and R is not the correct explanation for A
(i) A is True but R is False
(j) A is false but R is True
17 Assertion(A):Global variable is declared outside all the functions. 1
Reasoning(R):It is accessible throughout all the functions.
18 Assertion(A):Binary files store all data in text format. 1
Reasoning(R):Binary files data remain in its original type.
Section B
19 Rajat has written the following Python code. There are some errors in it. 2
Rewrite the correct code and underline the corrections made.
DEF execmain():
x=input("Enter a number:") if
(abs(x)=x):
print("You entered a positive number")
else:
x=*-1
print"Number made positive:"x execmain()
20 Differentiate between char and varchar in SQL with appropriate examples. 2
OR
What are different types of SQL Aggregate Functions? Give two examples.
21 e. Find output generated by the following 1+1
code: mystr = “Hello I am a Human.”
print(mystr[::-3])

f. Write the output of the code given


below: p=10
q=20
p*=q//3
p=q**2
q+=p
print(p,q)
22 Differentiate between DDL and DML with one Example each. 2
23 Explain the use of ‘Primary Key’ in a Relational Database Management System. Give 2
example to support your answer.
24 Predict the output of the following code:
mylist=[2,14,54,22,17]
tup=tuple(mylist)
for i in tup:
print(i%3, end=",") or
24 def CALLME(n1=1,n2=2): 2
n1=n1*n2
n2+=2
print(n1,n2)
CALLME()
CALLME(3)
25 Answer the following: 2
i) Name the package imported for connecting Python with MySQL database.
ii) What is the purpose of cursor object?
OR
What is foreign key in MySQL database? Give an example.
Section-C
26 c. Consider the following tables Trainer and Course: 1+2

What will be the output of the following statement?


SELECT * FROM TRAINER NATURAL JOIN COURSE;

d. Write the Outputs of the MySQL queries(i) to(iv)based on the given above tables:
a. SELECT DISTINCT(CITY) FROM TRAINER WHERE SALARY>80000;
b. SELECT TID,COUNT(*),MAX(FEES) FROM COURSE GROUP BY TID HAVING
COUNT(*)>1;
c. SELECT T.TNAME,C.CNAME FROM TRAINER T,COURSE C WHERE T.TID=C.TID AND
T.FEES<10000;
SELECT COUNT(CITY),CITY FROM TRAINER GROUP BY CITY;
27 Write a method/function COUNTLINES_ET() in python to read lines from a text file
REPORT.TXT, and COUNT those lines which are starting either with ‘E’ or starting with
‘T’ and display the Total count separately.
For example: If REPORT.TXT consists of
“ENTRY LEVEL OF PROGRAMMING CAN BE LEARNED FROM PYTHON. ALSO, IT IS VERY
FLEXIBLE LANGUGAE. THIS WILL BE USEFUL FOR VARIETY OF USERS.”
Then, Output will be:
No. of Lines with E:1
No. of Lines with T : 1
OR
Write a method/function SHOW_TODO() in python to read contents from a textfile
ABC.TXT and display those lines which have occurrence of the word ‘‘TO’’ or ‘‘DO’’.
For example:
If the content of the fileis
“THIS IS IMPORTANT TO NOTE THAT SUCCESS IS
THE RESULT OF HARD WORK. WE ALL ARE
EXPECTEDTO DO HARDWORK.
AFTER ALL EXPERIENCE COMES FROM HARD WORK.”
The method/function should display:
THIS IS IMPORTANT TO NOTE THAT
WE ALL ARE EXPECTED TO DO HARD WORK.

28 Python function oddeve(L) to print positive numbers in a list L. 3


Example: Input:[4, -1,5, 9,-6, 2,-9, 8]
Output: [4, 5, 9, 2,8]
29 Write a function AddCustomer(Customer) in Python to add a new Customer name into 3
the stack (list) CStack and display the information.
or
Write a function DeleteCustomer() to delete a Customer information from a list of
CStack. The function delete the name of customer from the stack.
Example : If the stack contains[“Abhinav”,”Vimank”],
the output should be:
Vimank
Abhinav
30 c. Write the outputs of the SQL queries (i) to (iv)based on the relations Teacher and
Posting given below:

ix. SELECT Department, count(*) FROM Teacher GROUP BY Department;


x. SELECT Max(Date_of_Join),Min(Date_of_Join) FROM Teacher;
xi. SELECT Teacher.name, Teacher.Department, Posting.Place FROM Teacher, Posting
WHERE Teacher.Department=Posting.Department AND Posting.Place=”Delhi”;
xii. SELECT Gender, COUNT(Gender) FROM Teacher GROUP BY Gender;

b.Write the command to view the schema of the table Teacher.

Section-D
31 Aman is a Python programmer. He has written a code and created a binary file 4
record.dat with employeeid, ename and salary. The file contains 10 records.
Write the code to update a record based on the employee id entered by the user and
update the salary.
32 Consider the following dept and worker tables. Find outputs for sql queries (i) to (iii): 4
Table : DEPT
DCODE DEPARTMENT CITY
D01 MEDIA DELHI
D02 MARKETING DELHI
D03 INFRASTRUCTURE MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI
Table : WORKER
WNO NAME DOJ DOB GENDER DCODE
1001 George K 2013-09-01 1991-09-01 MALE D01
1002 Ryma Sen 2012-12-11 1990-12-15 FEMALE D03
1003 Mohitesh 2013-02-03 1987-09-04 MALE D05
1007 Anil Jha 2014-01-17 1984-10-19 MALE D04
1004 Manila Sahai 2012-12-09 1986-11-14 FEMALE D01
1005 S SAHAY 2013-11-18 1987-03-31 MALE D02
1006 Jaya Priya 2014-06-09 1985-06-23 FEMALE D05

ix) Display no. of employees from each department


x) Display details of workers from Finance department
xi) Show the name and age of the workers when they joined the company.
xii) Show the names of the workers whose name starts with ‘M’ or ‘G’
Section-E
33 What is the use of tell() function? 1+4
Write a program in Python that defines and calls the following user defined functions:
v. Add(): to add the record of a student to a csv file “record.csv”. Each record
should be with field elements [admno,sname,class]
vi. Count(): to count the number of students studying in class 12
OR
Give a difference between dump and load function. Write a program in Python that
defines and calls the following user defined functions:
v. Add(): to add the record of an animal to a csv file “animal.csv”. Each record
should be with field elements [animalname, animaltype, animalfood]
vi. Search(): to print all the animal names who eat grass as their food.
34 b) Avni is trying to connect Python with MySQL for her project. Help her to write 2+3
the python statement on the following:
i. Name the library, which should be imported to connect MySQL with Python.
ii. Name the function, used to run SQL query in Python.
iii. WritePythonstatementofconnectfunctionhavingtheargumentsvaluesas:
Host name :192.168.11.111 User : root Password:Admin
Database: MYPROJECT

(b)Write the output of following python code:


def result(s):
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]>='n' and s[i]<='z'): m =
m + s[i-1]
elif(s[i].isupper()):
m=m+s[i].lower()
else:
m = m +'#'
print(m)
result('Cricket')
OR
(a) Find the output
Msg1="WeLcOME"
Msg2="GUeSTs" Msg3=""
for Iin range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print(Msg3)
b) Your friend Jagdish is writing a code to fetch data from a database Shop and table
name Products using Python. He has written incomplete code. You have to help him
write complete code:
import as m #Statement-1
object1 = m.connect(host="localhost", user="root", password="root", database="Shop")
object2=object1 _______ #Statement-2
query= '''SELECT * FROM Products WHERE NAME LIKE "A%";'''
object2. (query) #Statement 3
object1.close()
35 What is the advantage of using pickle module?
Write a program to write into a CSV file “one.csv” Rollno, Name and Marks separated
by comma. It should have header row and then take input from the user for all
following rows. The format of the file should be as shown if user enters 2 records.
Roll.No, Name, Marks
20, Ronit, 67
56, Nihir, 69
OR
What is difference between tell() and seek()methods?
Write a program to read all content of
“student.csv” and display records of
only those students who scored
more than 80 marks. Records
stored in students is in format :
[Rollno, Name, Marks]
 


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI II MID TERM – 2023-24 Time : 3 Hrs


Subject : Computer Science Max.
Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.
Section A
1. Expand the following : a) WWW b) GUI
2. List all relational operators.
3. Name 2 explicit type conversion functions.
4. Infinite loop is an example of ______ error.
5. Identify the data type of the following literals :
a) Great Day b) 3+4j
6. Name any 2 mutable data types.
7. The following code is written to print number from 1 to 100 but the output is not correct,
write the corrected code:
a=1
while a>100:
print(a)
a=a+1
8. Draw the Boolean circuit for the expression : 𝐴𝐵 + 𝐶𝐷
9. Give example of a) Touch-based interface b) Voice-based interface
10. What are the possible outputs of the statement - print(random.randrange(5,20,2))
11. How do you insert a comment in a python code?
12. Write the 2 boolean constants.
13. Clock speed of the system is measured in ________
14. _____ function is used to find the data type of the variable.
15. Arrange the following in the increasing order of size:
ZB, YB, KB, TB, MB, GB,
16. ______ and______ are unconditional jump statements.
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
i) Both A and R are true and R is the correct explanation for A
j) Both A and R are true and R is not the correct explanation for A
k) A is True but R is False
l) A is false but R is True
17. Assertion : Slicing is used to get a part of a sequence.
Reason : Slicing can be used for any data type.
18. Assertion : Looping construct are used for iteration.
Reason : Iteration is used to repeat a set of instructions
Section B (7x2=14)
19. Write a python code to accept a number and print if it is a multiple of 2, 3, 5 or 7 using
conditional statement. (Note: if the given number is a multiple of 2 and 7 it should show both)
20. Write a while loop to generate the following series : 2,4,8,16…2n
21. List the rules for naming an identifier in python.
22. Group the following as keywords and identifiers :
break, marks1, pass, length
23. Draw a flowchart to accept age and print ‘eligible to vote’ if the age is >=18 otherwise print
‘not eligible to vote’.
24. Rewrite the following code after removing the errors, underline each correction :

25. Evaluate the following statement:


a) 10 +(5-2) * 4 + 2**3**2 b) 12 and 0 or not 12<5+5>-5
Section C (5x3=15)
26. Predict the output of the code given below :
message= ‘Fortune favours the bold’
print(message[6])
print(message[4:18])
print(message[-4:-18:-2])
print(message[-10:-2:2])
print(message[:10])
print(message[::4])

27. Prove the following equations using Truth Table.


a) 𝑥 + 𝑥̅ 𝑦 = 𝑥 + 𝑦 b) A+BC= (A+B).(A+C)

28. Explain 3 functions from statistics module with example.

29. Write a python script to accept 2 numbers and generate a random number between the two
numbers.

30. Write logical expressions corresponding to the following statements in python :


a) alphabet ‘p’ exists in string name
b) √𝑎 + 𝑏 =c
c) create a list of any 3 colours
Section D (2x4=8)
31.Define the following terms :
a) System software b) Analytic Engine c) Secondary Memory d) Low-level language
32. What are different types assignment operators in python? Explain with example.
Section E (3x5=15)
33.Convert the following numbers :
g) 245.32(8) to decimal
h) 895.89(10) to hexadecimal
i) 1100011.1101(2) to octal

34. Write a python code to accept weight and height of a person and calculate the BMI (formula
weight(kg)/height(m)2) and display as per the following criteria :
BMI is <18.5 - underweight

BMI is 18.5 to <25 - healthy weight


BMI is 25.0 to <30 – overweight
BMI is 30.0 or higher – obesity
Or
Write a python code to accept the colour of the traffic light (RED, YELLOW, GREEN) and display
the following :
RED- “STOP, your life is precious’
YELLOW – “Please WAIT, till the light is Green’
GREEN – ‘GO! Thank you for being patient’
Any other colour – Please enter a valid Traffic light color

35. List any five list functions and explain the same with example.
 



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI I MID TERM – 2023-24 Time : 3 Hrs


Subject : Computer Science Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
9. Please check this question paper contains 35 questions.
10. The paper is divided into 4 Sections- A, B, C, D and E.
11. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
12. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
13. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
14. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
15. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
16. All programming questions are to be answered using Python Language only.
Section A
1. 1 Terrabyte = 1024 ______
2. Give 2 example of FOSS.
3. ___ symbol is used to represent a line as comment in python.
4. ___ is the repetition operator for strings.
5. Write the output of the following statement :
print(“Good\nDay\nbegins”)
6. Name any 2 mutable data types.
7. The following code is written to print number from 1 to 100 but the output is not correct, write the
corrected code:
for a in range(1,100):
print(a)
8. When does the ‘else’ statement in the ‘while’ loop gets executed?
9. ____ function returns the address of a variable.
10. Write the Boolean expression for the following Boolean circuit:

11. Arrange the following operators in the increasing order of their precedence:
**, * , +, <, not , or
12. List the logical operators.
13. How is = different from == ?
14. Expand a) ASCII b)FOSS
15. Classify the following into input devices and output devices :
Keyboard, Printer, Joystick, Mike, Speaker, Scanner
16. Define Cache Memory.
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
m) Both A and R are true and R is the correct explanation for A
n) Both A and R are true and R is not the correct explanation for A
o) A is True but R is False
p) A is false but R is True
17. Assertion : RAM is a volatile memory.
Reason : The contents of RAM is lost if the power is off.
18. Assertion : Mutable datatypes cannot be changed in place.
Reason : List is a mutable data type.
Section B (7x2=14)
19. How is a Microcontroller different Microprocessor?
20. Rewrite the following code after removing the errors :
n=int(input(“Enter a number:”)
if n>9 And n<100
print(“Two digit number’)
21. List the mutable data types and declare one variable for each mutable data type.
22. Prove using truth table A.(B+C)=AB+AC
23. Group the identifiers as valid and invalid :
a) AB_1 b) P@4 c) _1m d) 1_m
24. Write a ‘for’ loop to generate the following numbers : 2,8,13,18, 23, ….100
25. Evaluate the following statement:
a) 3+4-7*3 > 59 and 4+3-8 < 6*4//2 b) “All” and “best” or “last” not 0
Section C (5x3=15)
26. Identify the underlined tokens from the code given below :
m=int(input(“Enter a number”) #1
b=m+ 15 #2, 3,4
print(“Good”) #5, 6

27. State and prove Demorgans Theorem using Truth Table.

28. Explain range() and its parameters with example.

29. Predict the output :


for x in range(1,4):
for y in range (2,5):
if x*y>10:
break
print(x*y)

30. Write logical expressions corresponding to the following statements in python :


a) num3 lies between 10 and 20 (both inclusive)
b) val is a positive digit
c) string quote is not empty

Section D (2x4=8)
31.Define the following terms :
a) Operating system b) Language translators c) General Purpose Software d) Cache Memory
32. What are different types of errors encountered in the process of debugging? Give example for each.
Section E (3x5=15)
33.Convert the following numbers :
j) 341.67(8) to decimal
k) 579.23(10) to hexadecimal
l) 111011(2) to decimal
34. Write a python code to calculate the ticket amount for an event based on the following criteria:
Ticket Amount for adult is Rs.100 and for children in Rs.20. A discount of 10% is given if the total ticket
amount exceeds 500.
Or
Write a python code to calculate the total water bill of the month depending upon the number of units
consumed by the customer as per the following criteria:
For the first 100 unit @ 5 per unit
For the next 150 units @ 10 per unit
More than 250 units @ 20 per unit
Also add meter charges of 75 per month to calculate the total water bill.

35. What are the different type of operators in python. Explain with example.
 


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII I MID TERM – 2023-24 Time : 3 Hrs


Subject : Computer Science Max. Marks:70
General Instructions:
This question paper contains five sections, Section A to E. All questions are compulsory.
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.

SECTION A
1. State True or False 1
“Variable declaration is implicit in Python.”
2. Which of the following is an invalid datatype in Python? 1
(a) Set (b) None (c)Integer (d)Real
3. Given the following dictionaries 1
dict_exam={"Exam":"AISSCE", "Year":2023}
dict_result={"Total":500, "Pass_Marks":165}
Which statement will merge the contents of both dictionaries?
a. dict_exam.update(dict_result)
b. dict_exam + dict_result
c. dict_exam.add(dict_result)
d. dict_exam.merge(dict_result)
4. Consider the given expression: 1
not True and False or True
Which of the following will be correct output if the given expression is
evaluated?
(a) True
(b) False
(c) NONE
(d) NULL
5. Select the correct output of the code: 1
a = "Year 2022 at All the best"
a = a.split('2')
b = a[0] + ". " + a[1] + ". " + a[3]
print (b)

(a) Year . 0. at All the best


(b) Year 0. at All the best
(c) Year . 022. at All the best
(d) Year . 0. at all the best
6. Which of the following mode in file opening statement results or 1
generates an error if the file does not exist?
(a) a+ (b) r+ (c) w+ (d) None of the above
7. Fill in the blank: 1
command is used to remove primary key from the table in SQL.
(a) update (b)remove (c) alter (d)drop
8. Which of the following commands will delete the table from MYSQL 1
database?
(a) DELETE TABLE
(b) DROP TABLE
(c) REMOVE TABLE
(d) ALTER TABLE
9. Which of the following statement(s) would give an error after 1
executing the following code?

S="Welcome to class XII" # Statement 1


print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5

(a) Statement 3
(b) Statement 4
(c) Statement 5
(d) Statement 4 and 5
10. Fill in the blank: 1

is a non-key attribute, whose values are derived from the


primary key of some other table.
(a) Primary Key
(b) Foreign Key
(c) Candidate Key
(d) Alternate Key
11. The correct syntax of seek() is: 1
(a) file_object.seek(offset [, reference_point])
(b) seek(offset [, reference_point])
(c) seek(offset, file_object)
(d) seek.file_object(offset)
12. Fill in the blank: 1
The SELECT statement when combined with clause,
returns records without repetition.
(a) DESCRIBE
(b) UNIQUE
(c) DISTINCT
(d) NULL
13. Which of the following statements is FALSE about keys in a relational 1
database?
a. Any candidate key is eligible to become a primary key.
b. A primary key uniquely identifies the tuples in a relation.
c. A candidate key that is not a primary key is a foreign key.
d. A foreign key is an attribute whose value is derived from the primary
key of another relation.
14. What will the following expression be evaluated to in Python? 1
print(15.0 / 4 + (8 + 3.0))
(a) 14.75 (b)14.0 (c) 15 (d) 15.5
15. Which function is used to display the total number of records from 1
table in a database?
(a) sum(*)
(b) total(*)
(c) count(*)
(d) return(*)
16. Which of the following functions changes the position of file pointer and 1
returns its new position?
a. flush()
b. tell()
c. seek()
d. offset()

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):- If the arguments in function call statement match the 1
number and order of arguments as defined in the function definition,such
arguments are called positional arguments.
Reasoning (R):- During a function call, the argument list first contains
default argument(s) followed by positional argument(s).

18. Assertion (A): CSV (Comma Separated Values) is a file format for data 1
storage which looks like a text file.
Reason (R): The information is organized with one record on each line
and each field is separated by comma.
SECTION B
19. Rao has written a code to input a number and check whether it is 2
prime or not. His code is having errors. Rewrite the correct code and
underline the corrections made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
20. Write a function countNow(PLACES) in Python, that takes the dictionary, 2
PLACES as an argument and displays the names (in uppercase)of the
places whose names are longer than 5 characters.
For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be:
LONDON
NEW YORK
OR
Write a function, lenWords(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 "Come let us have some fun", the tuple will
have (4, 3, 2, 4, 4, 3)
21. (a) Given is a Python string declaration: 1
myexam="@@CBSE Examination 2022@@"
Write the output of: print(myexam[::-2])
(b) Write the output of the code given below:
my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27 1
my_dict['address'] = "Delhi"
print(my_dict.items())
22. Explain the use of ‘Foreign Key’ in a Relational Database Management 2
System. Give example to support your answer.
23. Ms. Shalini has just created a table named “Employee” containing 2
columns Ename, Department and Salary.
After creating the table, she realized that she has forgotten to add a
primary key column in the table. Help her in writing an SQL command to
add a primary key column EmpId of integer type to the table Employee.
Thereafter, write the command to insert the following record in the table:
EmpId- 999
Ename- Shweta
Department: Production
Salary: 26900
OR
Zack is working in a database named SPORT, in which he has created a
table named “Sports” containing columns SportId, SportName,
no_of_players, and category. After creating the table, he realized that
the attribute, category has to be deleted from the table and a new
attribute TypeSport of data type string has to be added. This attribute
TypeSport cannot be left blank. Help Zack write the commands to
complete both the tasks.
24. Predict the output of the Python code given below:
def Diff(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
or
Predict the output of the Python code given below: 2
tuple1 = (11, 22, 33, 44, 55 ,66)
list1 =list(tuple1)
new_list = []
for i in list1:
if i%2==0:
new_list.append(i)
new_tuple = tuple(new_list)
print(new_tuple)
25. Differentiate between count() and count(*) functions in SQL with 2
appropriate example.
OR

Categorize the following commands as DDL or DML:


INSERT, UPDATE, ALTER, DROP
SECTION C
26. (a) Consider the following tables – Bank_Account and Branch: 1+2

Table: Bank_Account
ACode Name Type
A01 Amrita Savings
A02 Parthodas Current
A03 Miraben Current
Table: Branch 1+2

ACode City
A01 Delhi
A02 Mumbai
A01 Nagpur

a) What will be the output of the following statement?


SELECT * FROM Bank_Account NATURAL JOIN Branch;
(b) Write the output of the queries (i) to (iv) based on the table,
TECH_COURSE given below:
Table: TECH_COURSE

CID CNAME FEES STARTDATE TID


C201 Animation and VFX 12000 2022-07-02 101
C202 CADD 15000 2021-11-15 NULL
C203 DCA 10000 2020-10-01 102
C204 DDTP 9000 2021-09-15 104
C205 Mobile Application 18000 2022-11-01 101
Development
C206 Digital marketing 16000 2022-07-25 103
(i) SELECT DISTINCT TID FROM TECH_COURSE;
(ii) SELECT TID, COUNT(*), MIN(FEES) FROM
TECH_COURSE GROUP BY TID HAVING
COUNT(TID)>1;
(iii) SELECT CNAME FROM TECH_COURSE
WHEREFEES>15000 ORDER BY CNAME;
(iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE
FEES BETWEEN 15000 AND 17000;
27. Write a method COUNTLINES() in Python to read lines from text file 3
‘TESTFILE.TXT’ and display the lines which are not starting with any
vowel.
Example: If the file content is as follows:
An apple a day keeps the doctor away.
We all pray for everyone’s safety.A marked difference will come
in our country.
The COUNTLINES() function should display the output as:
The number of lines not starting with any vowel - 1
OR
Write a function ETCount() in Python, which should read each
character of a text file “TESTFILE.TXT” and then count and display
the count of occurrence of alphabets E and T individually (including
small cases e and t too).
Example: If the file content is as follows:
Today is a pleasant day.It might
rain today.
It is mentioned on weather sites
The ETCount() function should display the output as:
E or e: 6
T or t : 9

28. (a) Write the outputs of the SQL queries (i) to (iv) based on the 3
relations Teacher and Placement given below:

Table : Teacher
T_ID Name Age Department Date_of_join Salary Gen
der
1 Arunan 34 Computer Sc 2019-01-10 12000 M
2 Saman 31 History 2017-03-24 20000 F
3 Randeep 32 Mathematics 2020-12-12 30000 M
4 Samira 35 History 2018-07-01 40000 F

5 Raman 42 Mathematics 2021-09-05 25000 M


6 Shyam 50 History 2019-06-27 30000 M
7 Shiv 44 Computer Sc 2019-02-25 21000 M
8 Shalakha 33 Mathematics 2018-07-31 20000 F

Table : Placement
P_ID Department Place
1 History Ahmedabad
2 Mathematics Jaipur
3 Computer Sc Nagpur

(i) SELECT Department, avg(salary) FROM Teacher


GROUP BY Department;
ii) SELECT MAX(Date_of_Join),MIN(Date_of_Join) FROM
Teacher;
ii) SELECT Name, Salary, T.Department, Place FROM
Teacher T, Placement P WHERE T.Department =
P.Department AND Salary>20000;
iv) SELECT Name, Place FROM Teacher T, Placement P
WHERE Gender =’F’ AND T.Department=P.Department;
(b) Write the command to view all tables in a database.
29. Write a function INDEX_LIST(L), where L is the list of elements passed 3
as argument to the function. The function returns another list named
‘indexList’ that stores the indices of all Non-Zero Elements of L.

For example:

If L contains [12,4,0,11,0,56]

The indexList will have - [0,1,3,5]


30. Predict the output of the Python code given below: 3

SECTION D
31 Vedansh is a Python programmer working in a school. For the
2+2
Annual Sports Event, he has created a csv file named Result.csv,
to store the results of students in different sports events. The
structure of Result.csv is :
[St_Id, St_Name, Game_Name, Result]
Where
St_Id is Student ID (integer)
ST_name is Student Name (string)
Game_Name is name of game in which student is
participating(string)
Result is result of the game whose value can be either 'Won',
'Lost' or 'Tie'
For efficiently maintaining data of the event, Vedansh wants to
write the following user defined functions:
Accept() – to accept a record from the user and add it to the file
Result.csv. The column headings should also be added on top of
the csv file.
wonCount() – to count the number of students
who have won any event.
As a Python expert, help him complete the task.
32. (a) Write the output of the code given below: 2+2

p=5
def sum(q,r=2):
global p
p=r+q**2
print(p, end= '#')
a=10
b=5
sum(a,b)
sum(r=5,q=1)
(b) What is the difference between mutable and
immutable data types.
OR
(a) Predict the output of the code given below:
s="welcome2cs"
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] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m +
s[i].lower()
else:
m = m +'&'
print(m)
b) What is the difference between ‘is’ and ‘in’ operator?

SECTION - E
33 (i) Differentiate between r+ and w+ file modes in Python. 2+3=5
(ii) Consider a file, SPORT.DAT, containing records of the following structure:
[SportName, TeamName, No_Players]
Write a function, copyData(), that reads contents from the file SPORT.DAT and
copies the records with Sport name as “Basket Ball” to the file named BASKET.DAT.
The function should return the total number of records copied to the file
BASKET.DAT.
OR
(i) How are text files different from binary files?
(ii) A Binary file, CINEMA.DAT has the following structure:
{MNO:[MNAME, MTYPE]}
Where
MNO – Movie Number
MNAME – Movie Name
MTYPE is Movie Type
Write a user defined function, findType(mtype), that accepts mtype as parameter
and displays all the records from the binary file CINEMA.DAT, that have the value of
Movie Type as mtype.
34 Navdeep creates a table RESULT with a set of records to maintain the marks
secured by students in Sem 1, Sem2, Sem3 and their division. After creation of the
table, he has entered data of 7 students in the table.
ROLL_NO SNAME SEM1 SEM2 SEM3 DIVISION
101 KARAN 366 410 402 I
102 NAMAN 300 350 325 I
103 ISHA 400 410 415 I
104 RENU 350 357 415 I
105 ARPIT 100 75 178 IV
106 SABINA 100 205 217 II
107 NEELAM 470 450 471 I

Based on the data given above answer the following questions:

(i) Identify the most appropriate column, which can be consideredas


Primary key.
(ii) If two columns are added and 2 rows are deleted from the table result,
what will be the new degree and cardinality of the above table?
(iii) Write the statements to:
a. Insert the following record into the table
Roll No- 108, Name- Aadit, Sem1- 470, Sem2-444, Sem3-475,
Div – I.
b. Increase the SEM2 marks of the students by 3% whose
name begins with ‘N’.
OR (Option for part iii only)
(iii) Write the statements to:
a. Delete the record of students securing IV division.
b. Add a column REMARKS in the table with datatype as
varcharwith 50 characters
35 a) What is the difference between text file and binary file?
b)Aman is a Python programmer. He has written a code and created a
binary file record.datwith employeeid, ename and salary. The filecontains
10 records. He now has to update a record based on the employee id
entered bythe user and update the salary. The updated record is then to
be written in the file temp.dat. The records which are not to be updated
also have to be written to the file temp.dat. If the employee id is not
found, an appropriate message should to be displayed.
As a Python expert, help him to complete the following code based onthe
requirement given above:

import #Statement 1
def update_data():
rec={}
fin=open("record.dat","rb")
fout=open(" ") #Statement 2
found=False
eid=int(input("Enter employee id to update
their salary :: "))
while True:
try:
rec= #Statement 3
if rec["Employee id"]==eid:
found=True
rec["Salary"]=int(input("Enter new salary
:: "))
pickle. #Statement 4
else:
pickle.dump(rec,fout)
except:
break
if found==True:
print("The salary of employee id ",eid," has
been updated.")
else:
print("No employee with such id is not found")
fin.close()
fout.close()
1
(i) Which module should be imported in the program?(statement1)
(ii) Write the correct statement required to open a temporary file 1
named temp.dat. (Statement 2)
(iii) Which statement should Aman fill in Statement 3 to read the 2
data from the binary file, record.dat and in Statement 4 to
write the updated data in the file, temp.dat?
1
(iv) What is the datatype of the object ‘found’ and ‘rec’?


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI CYCLE TEST (JULY) – 2023-24 Time : 2 periods


Subject : Computer Science Python Basics Max. Marks:25
I. Answer the following : (7x3=21)
6. Give 3 mutable and 3 immutable data types.
7. List the symbols of all mathematical operators with the purpose.
8. List the symbols of all relational operators and its meaning.
9. List the symbols of all assignment operators with its purpose.
10. Identify the data
of the following variable :
S=[11,22,33] M=”Good Day” F=(14,15,”Well”)
P=3+4j G=15567 T=2.765
6. Evaluate the following expression :
i) 15 and 0 or 24 ii) 34+16 – 27 < 12 or False iii) “abc” and 15+3 or 19
7. Write the output of the following code :
a=15
b=21
print(a, “ and “, b, “ = “, a+b, “mathematical operator +”)
print(a<b,a>b,a==b)
#print(“this’s is a good practice”)



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XI CYCLE TEST (JULY) – 2023-24 Time : 2 periods


Subject : Computer Science Python Basics Max. Marks:25
I. Answer the following : (7x3=21)
6. Give 3 mutable and 3 immutable data types.
7. List the symbols of all mathematical operators with the purpose.
8. List the symbols of all relational operators and its meaning.
9. List the symbols of all assignment operators with its purpose.
10. Identify the data
of the following variable :
S=[11,22,33] M=”Good Day” F=(14,15,”Well”)
P=3+4j G=15567 T=2.765
6. Evaluate the following expression :
i) 15 and 0 or 24 ii) 34+16 – 27 < 12 or False iii) “abc” and 15+3 or 19
7. Write the output of the following code :
a=15
b=21
print(a, “ and “, b, “ = “, a+b, “mathematical operator +”)
print(a<b,a>b,a==b)
#print(“this’s is a good practice”)
II. Write python program for the following : (4)

To accept length, breadth and height of a cuboid and print its volume (lxbxh) and Total Surface
area 2 (lb+bh+lh). (4)

II. Write python program for the following : (4)

To accept length, breadth and height of a cuboid and print its volume (lxbxh) and Total Surface
area 2 (lb+bh+lh). (4)


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII CYCLE TEST (JULY) – 2023-24 Time : 2 periods


Subject : Computer Science SQL Max. Marks:25

Table: PRODUCT Table: BRAND


PCode PName UPrice Rating BID BID BName
P01 Shampoo 120 6 M03 M02 Dant Kanti
P02 Toothpaste 54 8 M02 M03 Medimix
P03 Soap 25 7 M03 M04 Pepsodent
P04 Toothpaste 65 4 M04 M05 Dove
P05 Soap 38 5 M05
P06 Shampoo 245 6 M05

Write the Query and output for the following : ( 6 x 2 =12)


1. Display product name and brand name from the tables PRODUCT and BRAND.
2. Display the structure of the table PRODUCT.
3. Display the average rating of Medimix and Dove brands
4. Display the name, price, and rating of products in descending order of rating.
5. Display number of products available in each brand.



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII CYCLE TEST (JULY) – 2023-24 Time : 2 periods


Subject : Computer Science SQL Max. Marks:25

Table: PRODUCT Table: BRAND


PCode PName UPrice Rating BID BID BName
P01 Shampoo 120 6 M03 M02 Dant Kanti
P02 Toothpaste 54 8 M02 M03 Medimix
P03 Soap 25 7 M03 M04 Pepsodent
P04 Toothpaste 65 4 M04 M05 Dove
P05 Soap 38 5 M05
P06 Shampoo 245 6 M05

Write the Query and output for the following : ( 6 x 2 =12)


1. Display product name and brand name from the tables PRODUCT and BRAND.
2. Display the structure of the table PRODUCT.
3. Display the average rating of Medimix and Dove brands
4. Display the name, price, and rating of products in descending order of rating.
5. Display number of products available in each brand.

6. Display the product name which starts with the alphabet ‘S’.
7. List the Product names without repetition
8. Display product details whose price is more than 100.

Write SQL queries for the following: (9)


1. Create the table product (only structure with necessary constraints) (2)
2. Create the table brand (only structure with necessary constraints) (2)
3. To insert the values of first row (P01, Shampoo, 120, 6, M03) in the table product
4. To increase the price of all Toothpaste by 10 rupees.
5. Add a column City in the table BRAND.
6. To remove the details of Dove from Brand table.
7. To delete the table brand along with its structure.

6. Display the product name which starts with the alphabet ‘S’.
7. List the Product names without repetition
8. Display product details whose price is more than 100.

Write SQL queries for the following: (9)


1. Create the table product (only structure with necessary constraints) (2)
2. Create the table brand (only structure with necessary constraints) (2)
3. To insert the values of first row (P01, Shampoo, 120, 6, M03) in the table product
4. To increase the price of all Toothpaste by 10 rupees.
5. Add a column City in the table BRAND.
6. To remove the details of Dove from Brand table.
7. To delete the table brand along with its structure.

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII CYCLE TEST (JUNE) – 2023-24 Time : 40 min


Subject : Computer Science Max. Marks:25

Answer the following (5 x 5 = 25)


1. Differentiate between:
a) text file and binary file
b) readline() and readlines()
c) write() and writelines()
d) seek() and tell()
e) load() and dump()

2. Write the use and syntax for the following methods:


a) open()
b) read()
c) seek()
d) dump()
e) load ()

3. Write the 12 modes of file opening, its description and file offset position.

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII CYCLE TEST (JUNE) – 2023-24 Time : 40 min


Subject : Computer Science Max. Marks:25

Answer the following (5 x 5 = 25)


1. Differentiate between:
a) text file and binary file
b) readline() and readlines()
c) write() and writelines()
d) seek() and tell()
e) load() and dump()

2. Write the use and syntax for the following methods:


a) open()
b) read()
c) seek()
d) dump()
e) load ()

3. Write the 12 modes of file opening, its description and file offset position.
4. Write the file mode that will be used for opening the following files. Also, write the Python
statements to open the following files:
a) a text file “example.txt” in both read and write mode
b) a binary file “bfile.dat” in write mode
c) a text file “try.txt” in append and read mode
d) a binary file “btry.dat” in read only mode
e) to create a text file “log.txt” to write contents

5. When are the following built-inexceptions raised? Give examples to support your answers.
a) ValueError
b) IndexError
c) NameError
d) ZeroDivisionError
e) TypeError

4. Write the file mode that will be used for opening the following files. Also, write the Python
statements to open the following files:
a) a text file “example.txt” in both read and write mode
b) a binary file “bfile.dat” in write mode
c) a text file “try.txt” in append and read mode
d) a binary file “btry.dat” in read only mode
e) to create a text file “log.txt” to write contents

5. When are the following built-inexceptions raised? Give examples to support your answers.
a) ValueError
b) IndexError
c) NameError
d) ZeroDivisionError
e) TypeError
SMT. NDJA Vivekananda Vidyalaya Sr. Sec School, Ch – 39

Cycle Test – 2022-2023 (OCTOBER II) – Strings and Functions

Subject : COMPUTER Science Std : XI


Marks : 25
Answer the following questions (7 x 3 =21)
1. What is a string ? Declare a string and assign the value “God is Great”.
2. Write a function deleteChar() which takes two parameters one is a string and other is
a character. The function should create a new string after deleting all occurrences of
the character from the string and return the new string.
3. Explain the following string in-built functions ;
Count(), find(), index()
4. Explain String slicing with example for all parameters.
5. What is a function? List the different types of functions.
6. What is a module? What are the different ways in which a module can be imported?
7. Differentiate between local and global variable.

SMT. NDJA Vivekananda Vidyalaya Sr. Sec School, Ch – 39

Cycle Test – 2022-2023 (OCTOBER II) – Strings and Functions

Subject : COMPUTER Science Std : XI


Marks : 25

1. What is a string ? Declare a string and assign the value “God is Great”.
2. Write a function deleteChar() which takes two parameters one is a string and other is
a character. The function should create a new string after deleting all occurrences of
the character from the string and return the new string.
3. Explain the following string in-built functions ;
Count(), find(), index()
4. Explain String slicing with example for all parameters.
5. What is a function? List the different types of functions.
6. What is a module? What are the different ways in which a module can be imported?
7. Differentiate between local and global variable.
8. Consider the following string mySubject: (4)

mySubject = "Computer Science"

What will be the output of the following string operations :

i. print(mySubject[-7:-1])
ii. print(mySubject[::2])
iii. print(mySubject[len(mySubject)-1])
iv. print(2*mySubject)
v. print(mySubject[::-2])
vi. print(mySubject[:3] + mySubject[3:])
vii. print(mySubject.startswith('Comp'))
viii. print(mySubject.isalpha())

8. Consider the following string mySubject: (4)

mySubject = "Computer Science"

What will be the output of the following string operations :

i. print(mySubject[-7:-1])
ii. print(mySubject[::2])
iii. print(mySubject[len(mySubject)-1])
iv. print(2*mySubject)
v. print(mySubject[::-2])
vi. print(mySubject[:3] + mySubject[3:])
vii. print(mySubject.startswith('Comp'))
viii. print(mySubject.isalpha())
SMT. NDJA Vivekananda VidyalayaSr. SecSchool, Ch – 39

Cycle Test – 2022-2023 (OCTOBER II) - SQL

Subject : COMPUTER Science Std : XII


Marks : 25

Consider the following tables Employee and salary. Write SQL commands for the
statements (i) to (xiv) and give outputs for SQL queries (xv) to (xx)
Table : Employee

Eid Name Deptid Qualification Sex


1 Deepali Gupta 101 MCA F
2 RajatTyagi 101 BCA M
3 Hari Mohan 102 B.A M
4 Harry 102 M.A M
5 Sumit Mittal 103 B.Tech M
6 Jyoti 101 M.Tech F
Table : Salary

Eid Basic DA HRA Bonus


1 6000 2000 2300 200
2 2000 300 300 30
3 1000 300 300 40
4 1500 390 490 30
5 8000 900 900 80
6 10000 300 490 89

1.Create the table Employee and Table Salary with necessary constraints.(5)

2. Consider the following tables Employee and salary. Write SQL commands for the
statements (i) to (xiv) and give outputs for SQL queries (xv) to (xx)

(i) To show the name of employees department wise.

(ii) To list the names of those employees only whose basic is greater than 3000.

(iii) Add a column ‘Maritalstatus’ to employee with 1 character.

(iv) To print the net salary from salary table where as net salary is calculated as
basic+da+hra+bonus

(v) To increase the bonus of all employees with 200.

(vi) Display Eid, Ename, Basic, HRA and DA


(vii) Display number of employees department wise.

(viii) Display the highest and lowest basic

(ix) Display the names of employees whose name starts with ‘s’

(x) Show the details of salary in descending order of basic.

(xi) Display no. of employees, maximum basic and minimum basic for deptid 101

(xii) Display the name of the person who gets the maximum Basic

(xiii) Delete all the details of employee

(xiv) Delete the table Salary.

(xv) Select name from employee where eid=(select eid from salary where basic=
(select max(basic) from salary));

(xvi) select Avg(basic) from salary where bonus >40;

(xvii) Select count(*) from employee where sex=’F’;

(xviii)Select name from employee where qualification like ‘%Tech’

(xix) Select sum(basic) from salary group by deptid

(xx) Select count(distinct Basic) from Salary.

 


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL
I MID TERM EXAMINATION – 2022-2023
Std : XI Max Marks : 35
Subject : Computer Science Time : 1 ½ hrs
I. Objective type questions : (10 x 1 =10)
1. Who developed python?
2. List the two Boolean values.
3. List the mutable data types.
4. What are the 2 looping structures available in python?
5. List the rules of naming identifiers.
6. What the logical operators? List them.
7. Name the sequence data types in python.
8. What are the decision making statements in python?
9. What is the data type of the input() function?
10. How are comments included in the python code?
II. Case based question (4 x 1 =4)
11. Observer the following code and identify the tokens (any 4) that are underlined :
Python code to find the eligibility to vote or not :
Age=int(input(“Enter your age”)) - (1)
if Age>=18: - (2)
print(“Eligible to vote”) - (3)
else: - (4)
print(“Not eligible to vote”) - (5)


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL
I MID TERM EXAMINATION – 2022-2023
Std : XI Max Marks : 35
Subject : Computer Science Time : 1 ½ hrs
I. Objective type questions : (10 x 1 =10)
1. Who developed python?
2. List the two Boolean values.
3. List the mutable data types.
4. What are the 2 looping structures available in python?
5. List the rules of naming identifiers.
6. What the logical operators? List them.
7. Name the sequence data types in python.
8. What are the decision making statements in python?
9. What is the data type of the input() function?
10. How are comments included in the python code?
II. Case based question (4 x 1 =4)
11. Observer the following code and identify the tokens (any 4) that are underlined :
Python code to find the eligibility to vote or not :
Age=int(input(“Enter your age”)) - (1)
if Age>=18: - (2)
print(“Eligible to vote”) - (3)
else: - (4)
print(“Not eligible to vote”) - (5)
III. Very Short Answer (2 x 2 =4)
12. List all the relational operators with its meaning.
13. Evaluate the following (show the steps):
i) 12*3+4-12/3
ii) 25 and 13 or 11 and not 0

IV. Short Answer (3 x 3 =9)


14. What are punctuators? List any 4 punctuators.
15. List any three features of python programming language.
16. Identify the error in the following code :
Print(“Welcome”)
A=2
B=4
if A>B
pirnt(A, is the biggest number)
else
print(B,is the biggest number)

V. Answer in detail (2 x 4 =8)


17. Write a python code to accept 2 numbers from the user and print the result of all the
arithmetic operators.

18. Explain in detail about tokens in python.

III. Very Short Answer (2 x 2 =4)


12. List all the relational operators with its meaning.
13. Evaluate the following (show the steps):
i) 12*3+4-12/3
ii) 25 and 13 or 11 and not 0

IV. Short Answer (3 x 3 =9)


14. What are punctuators? List any 4 punctuators.
15. List any three features of python programming language.
16. Identify the error in the following code :
Print(“Welcome”)
A=2
B=4
if A>B
pirnt(A, is the biggest number)
else
print(B,is the biggest number)

V. Answer in detail (2 x 4 =8)


17. Write a python code to accept 2 numbers from the user and print the result of all the
arithmetic operators.

18. Explain in detail about tokens in python. 



SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL
I MID TERM EXAMINATION – 2022-2023
Std : XII Max Marks : 70
Subject : Computer Science Time : 3 hrs
General Instructions :
(i) This question paper contains two parts Part A and B. Each part is compulsory.
(ii) Both Part A and Part B have choices.
(iii) Part A has two sections :
a. Section I is short answer questions, to be answered in one word or one line.
b. Section II has two case study-based questions. Each case study has 5 case-based
subparts. An examinee is to attempt any 4 out of the 5 subparts.
(iv) Part B is Descriptive Paper.
(v) Part B has three sections :
a. Section I is short answer questions of 2 marks each in which two questions have internal
options.
b. Section II is long answer questions of 3 marks each in which two questions have internal
options.
c. Section III is very long answer questions of 5 marks each in which one question has an
internal option.
(vi) All programming questions are to be answered using Python Language only.

PART A
Section I (15x1=15)
Select the most appropriate option out of the options given for each question. Attempt any 15
questions from questions no. 1 to 21.
1. Name the Python Library modules which need to be imported to invoke the following
functions : (i) dump () (ii) factorial()
2. Write a statement in Python to open a text file CONTENT.TXT so that new contents can be
written in it.
3. Find the invalid identifier from the following
a) MyName b) True c) 2ndName d) My_Name
4. Given the lists L=[1,3,6,82,5,7,11,92] , write the output of print(L[2:5])
5. Write the full form of CSV.
6. Identify the valid arithmetic operator in Python from the following.
a) ? b) < c) ** d) and
7. What will be the output for the following python statement?
D={“AMIT”:90,”RESHMA”:96,”SUKHBIR”:92,”JOHN”:95}
print(“JOHN” in D, 90 in D,sept=”#”)
8. Dictionaries are also called as _____
9. What is the significance of pass statement?
10. Give a dictionary D={1:”one”}, write a statement to add the pair (2,”Two”).
11. What is a docstring?
12. What does the S contain for the following statement?
S=[a-1 for a in range(20,5,-2)]
13. Find the output of the following statement:
A=[[1,2,3,4,5],[6,7,8,9]]
print(A[1][2], A[2][1])
14. In the following declaration what is the significance of *
defabc(*a):
print(a)
15. What is the output of the following statement?
d1={1:2,2:3,3:4}
d2={1:2,2:3,3:4}
d1 is d2
16. Which statement among s1 and s2 will raise an error? Why?
a=[1,2,(3,4)]
b=(1,2,[3,4])
a[2][0]=30 #s1
b[2][0]=30 #s2
17. Write a python statement to check whether the variable ‘m’ is a 2 digit positive whole
number.
18. Declare a tuple containing the names of five states of India.
19. Find the output of the following statement :
S=”all are welcome”
print( S[-1:-10])
20. Find the module to be imported for the following functions:
randint() cos()
21.Which output lines of the following program will print the same results?
tup1 = (10, 20, 30, 40, 50, 60, 70, 80, 90)
print(tup1[5:-1]) # 1
print(tup1[5]) # 2
print(tup1[5:]) # 3
print(tup1[-4:8]) # 4

Section II (2 x 4 =8)

Both the case study-based questions are compulsory. Attempt any 4 sub-parts from each
question. Each question carries 1 mark.

22. Radha Shah is a programmer, who has recently been given a task to write a python code to
perform the following CSV file operations with the help of two user defined
functions/modules:

a. CSVOpen() : to create a CSV file called BOOKS.CSV in append mode containing information of
books – Title, Author and Price.

b. CSVRead() : to display the records from the CSV file called BOOKS.CSV where the field title
starts with 'R'. She has succeeded in writing partial code and has missed out certain
statements, so she has left certain queries in comment lines
You as an expert of Python have to provide the missing statements and other related queries
based on the following code of Radha. Answer any four questions (out of five) from the below
mentioned questions.

i. Write the appropriate mode in which the file is to be opened in append mode
(Statement 1)
ii. Write the statement to create a csv writer object in Statement 2.
iii. Write Statement 3 to write the names of the column headings in the CSV file,
BOOKS.CSV.
iv. Write statement to read a csv file in Statement 4.
v. Fill in the appropriate statement to check the field Title starting with ‘R’ for Statement 5
in the above program.

23. Your teacher has given you a method/function FilterWords() in python which read lines
from a text file NewsLetter.TXT, and display those words, which are lesser than 4 characters.
Your teachers intentionally kept few blanks in between the code and asked you to fill the
blanks so that the code will run to find desired result. Do the needful with the following python
code.
i. Write mode of opening the file in statement-1?
ii. Fill in the blank in statement-2 to read the data from the file.
iii. Fill in the blank in statement-3 to break the data word by word.
iv. Fill in the blank in statement-4, which display the word having lesser than 4 characters.
v. Fill in the blank in Statement-5 to close the file.

Part – B
Section – 1: (10 x 2 =20)
24 Which of the following are valid operators in Python ?
(i) += (ii) ^ (iii) in (iv) && (v) between (vi) */ (vii) is (viii) like

25. Rewrite the following code in Python after removing all syntax error(s). Underline each
correction done in the code.

26. Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.

27. Find and write the output of the following Python code :
28. Write a method/function BIGWORDS() in Python to read contents from a text file
CODE.TXT, to count and display the occurrence of those words, which are having 5 or more
alphabets.
For example : If the content of the file is
ME AND MY FRIENDS ENSURE SAFETY AND SECURITY OF EVERYONE
The method/function should display Count of big words is 5
Or
Write a method/function BIGLINES() in Python to read lines from a text file CONTENT.TXT, and
display those lines, which are bigger than 20 characters.
For example : If the content of the file is :
Stay positive and happy
Work hard and dont give up hope
Be open to criticism and keep learning
Surround yourself with happy, warm and genuine people
The method/function should display :
Be open to criticism and keep learning
Surround yourself with happy, warm and genuine people
29.

30. Find and write the output of the following Python code :
31. Find and write the output of the following python code :

32. Evaluate the following expressions:


a) 6 * 3 + 4**2 // 5 – 8 b) 10 > 5 and 7 > 12 or not 18 > 3

33. What possible outputs(s) are expected to be displayed on screen at the time of execution
of the program from the following code? Also specify the maximum values that can be
assigned to each of the variables Lower and Upper.

(i) 10#40#70# (ii) 30#40#50# (iii) 50#60#70# (iv) 40#50#70#

Section – II (4 x 3 =12)

34. Write definition of a method/function DoubletheOdd(Nums) to add and display twice of


odd values from the list of Nums.
For example : If the Nums contains [25,24,35,20,32,41]
The function should display Twice of Odd Sum: 202
Or
Write definition of a method/function FindOut(Names, HisName) to search for HisName string
from a list Names, and display the position of its presence.
For example : If the Names contain ["Arun","Raj","Tarun","Kanika"] and HisName contains
"Tarun"
The function should display Tarun at 2

35. Write a Python method/function SwitchOver(Val) to swap the even and odd positions of
the values in the list Val.
Note : Assuming that the list has even number of values in it.
For example : If the list Numbers contain [25,17,19,13,12,15] After swapping the list content
should be displayed as [17,25,13,19,15,12]
or
Write a Python method/function Count(Start,End,Step) to display natural numbers from Start
to End in equal intervals of Step and the sum of all the number.
For example : If the values of Start as 14, End as 35 and Step as 6 The method should be
displayed as 14, 20, 26, 32 Sum of all numbers : 92

36. Find and write the output of the following python code :

37. Explain LEGB rule in python with suitable example

Section III (3 x 5=15)


38. Write a method/function SOUTHTRADE() in Python to find and display the total amount of
trade happened in SOUTH region from a pickled file TRADING.DAT containing records of
TRADING whose structure is (Region, amount).
Or
Write a method/function GAMING() in Python to search and display all the content from a
pickled file GAMER.DAT(Id, Type) where Type of GAMER is "MOBILE".

39. Explain any four built-in functions of string data type.

40. Write a function to find and display the number of words, lower case characters, upper
case characters, vowels and digits in the text file notes.txt.
SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39
PERIODIC TEST – JULY – 2022-2023
Std : XII Marks : 25
Subject : Computer Science Time : 40 min
1. Find the output of the following program segments:( 6 x 2 =12)
(i) (ii) (iii)
a = 110 for i in range(20,30,2): country = 'INDIA'
while a > 100: print(i) for i in country:
print(a) print (i.lower())
a -= 2

(iv) (v) (vi)


i=0 for x in range(1,4): var = 7
sum = 0 for y in range(2,5): whilevar> 0:
while i < 9: if x * y > 10: print ('Current variable
if i % 4 == 0: break value: ', var)
sum = sum + i print (x * y) var = var -1
i=i+2 ifvar == 3:
print (sum) break
else:
ifvar == 6:
var = var -1
continue
print ("Good bye!")

SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39


PERIODIC TEST – JULY – 2022-2023
Std : XII Marks : 25
Subject : Computer Science Time : 40 min
1. Find the output of the following program segments:( 6 x 2 =12)

(i) (ii) (iii)


a = 110 for i in range(20,30,2): country = 'INDIA'
while a > 100: print(i) for i in country:
print(a) print (i.lower())
a -= 2

(iv) (v) (vi)


i=0 for x in range(1,4): var = 7
sum = 0 for y in range(2,5): whilevar> 0:
while i < 9: if x * y > 10: print ('Current variable
if i % 4 == 0: break value: ', var)
sum = sum + i print (x * y) var = var -1
i=i+2 ifvar == 3:
print (sum) break
else:
ifvar == 6:
var = var -1
continue
print ("Good bye!")

2. Write python code to find prime numbers between 2 to 50 using nested for loops.(4)

3. Explain range() in-built function with example.(4)


4. Write a python code to accept the annual salary and print the loan amount eligible
based on the following condition (5)

Annual salary Loan amount


1 lakh to =>2 lakh 2 times the annual salary
>2 lakh to =>5 lakh 4 times the annual salary
Above 5 lakh 6 times the annual salary

2. Write python code to find prime numbers between 2 to 50 using nested for loops.(4)

3. Explain range() in-built function with example.(4)

4. Write a python code to accept the annual salary and print the loan amount eligible
based on the following condition (5)

Annual salary Loan amount


1 lakh to =>2 lakh 2 times the annual salary
>2 lakh to =>5 lakh 4 times the annual salary
Above 5 lakh 6 times the annual salary

SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39

PERIODIC TEST – JUNE – 2022-2023 (RETEST)

Std : XII Marks : 25


Subject : Computer Science Time : 40 min

1. Explain logical operators in python. (5)

2. Explain any 4 features of python. (5)

3. Give example and exampling different type of errors in python. (5)

4. Write any 5 keywords and 5 identifiers in python. (5)

5. Evaluate:

1. 20 % 4 ** 2 // 7 + 12 / 3
2. 20%6< 5 or 25/5 == 5 and not 11>=11
3. 2+9*((3*12)-8)/10
4. “False”==False
5. 13>17<11

SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39

PERIODIC TEST – JUNE – 2022-2023 (RETEST)

Std : XII Marks : 25

Subject : Computer Science Time : 40 min

1. Explain logical operators in python. (5)

2. Explain any 4 features of python. (5)

3. Give example and exampling different type of errors in python. (5)

4. Write any 5 keywords and 5 identifiers in python. (5)

5. Evaluate:

1. 20 % 4 ** 2 // 7 + 12 / 3
2. 20%6< 5 or 25/5 == 5 and not 11>=11
3. 2+9*((3*12)-8)/10
4. “False”==False
5. 13>17<11

SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39

PERIODIC TEST – JUNE – 2022-2023

Std : XII Marks : 25


Subject : Computer Science Time : 40 min

1. Write 4 feature of python. (4)

2. List the 4 rules for naming an identifier in python . (4)

3. Write python Statement for the following : (4)

1. To assign value 10000 to a variable number.


2. To assign quotient of 154 divided by 12 to a variable x.
3. To create a list of five colours(any colour of your choice).
4. To check whether a is largest among a,b,c
5. To check whether ‘a’ is positive number.
6. To check number of characters in Quote is more than 10
7. To check whether string ‘Name’ contains vowels.
8. To assign “Good Day”(“ is also part of the string) to a variable String.

4. Write any 6 keywords and 2 identifiers in python. (4)

5. Evaluate the following : (4)

6. 18 % 4 ** 3 // 7 + 9 /3
7. 22%4 < 5 or 25/5 == 5 and not 12 >=9
8. 2+9*((3*12)-8)/10
9. ‘Bye’== “BYE”

6. List and explain relational operators in python. (5)

4. Write any 6 keywords and 2 identifiers in python. (4)


5. Evaluate the following : (4)

1. 18 % 4 ** 3 // 7 + 9 /3
2. 22%4 < 5 or 25/5 == 5 and not 12 >=9
3. 2+9*((3*12)-8)/10
4. ‘Bye’== “BYE”

6. List and explain relational operators in python. (5)

SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39

PERIODIC TEST – JUNE – 2022-2023

Std : XII Marks : 25

Subject : Computer Science Time : 40 min

1. Write any 4 features of python. (4)

2. List the 4 rules for naming an identifier in python. (4)

3. Write python Statement for the following : (4)

1. To assign value 10000 to a variable number.


2. To assign quotient of 154 divided by 12 to a variable x.
3. To create a list of five colours(any colour of your choice).
4. To check whether a is largest among a,b,c
5. To check whether ‘a’ is positive number.
6. To check number of characters in Quote is more than 10
7. To check whether string ‘Name’ contains vowels.
8. To assign “Good Day”(“ is also part of the string) to a variable String.

SMT NDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, VYASARPADI, CHENNAI -39

PERIODIC TEST – JUNE – 2022-2023

Std : XII Marks : 25

Subject : Computer Science Time : 40 min

1. Write 4 feature of python. (4)

2. List the 4 rules for naming an identifier in python . (4)

3. Write python Statement for the following : (4)


9. To assign value 10000 to a variable number.
10. To assign quotient of 154 divided by 12 to a variable x.
11. To create a list of five colours(any colour of your choice).
12. To check whether a is largest among a,b,c
13. To check whether ‘a’ is positive number.
14. To check number of characters in Quote is more than 10
15. To check whether string ‘Name’ contains vowels.
16. To assign “Good Day”(“ is also part of the string) to a variable String.

4. Write any 6 keywords and 2 identifiers in python. (4)

5. Evaluate the following : (4)

10. 18 % 4 ** 3 // 7 + 9 /3
11. 22%4 < 5 or 25/5 == 5 and not 12 >=9
12. 2+9*((3*12)-8)/10
13. ‘Bye’== “BYE”

6. List and explain relational operators in python. (5)

4. Write any 6 keywords and 2 identifiers in python. (4)

5. Evaluate the following : (4)

5. 18 % 4 ** 3 // 7 + 9 /3
6. 22%4 < 5 or 25/5 == 5 and not 12 >=9
7. 2+9*((3*12)-8)/10
8. ‘Bye’== “BYE”

6. List and explain relational operators in python. (5)


SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII CYCLE TEST (APRIL) – 2022-23 Time : 40 min


Subject : Computer Science Max. Marks:25

Answer the following (5 x 5 =25)


1. Differentiate between:
a) text file and binary file
b) readline() and readlines()
c) write() and writelines()
d) csv file and text file
e) writer() and writerow()

2. Write the use and syntax for the following methods:


a) open()
b) read()
c) seek()
d) dump()
e) load ()

3. Write the 12 modes of file opening, its description and file offset position.

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL, CHENNAI - 39

Std :XII CYCLE TEST (APRIL) – 2022-23 Time : 40 min


Subject : Computer Science Max. Marks:25

Answer the following (5 x 5 =25)


1. Differentiate between:
a) text file and binary file
b) readline() and readlines()
c) write() and writelines()
d) csv file and text file
e) writer() and writerow()

2. Write the use and syntax for the following methods:


a) open()
b) read()
c) seek()
d) dump()
e) load ()

3. Write the 12 modes of file opening, its description and file offset position.
4. Write the file mode that will be used for opening thefollowing files. Also, write the
Python statements to openthe following files:
a) a text file “example.txt” in both read and write mode
b) a binary file “bfile.dat” in write mode
c) a text file “try.txt” in append and read mode
d) a binary file “btry.dat” in read only mode
e) acsv file “names.csv” to search for a name.

5. Consider a csv file stock.csv containing (product id, description, rate) write function
for the following :
a) Add a new product to stock.csv
b) Display products whose rate is more then 50

4. Write the file mode that will be used for opening thefollowing files. Also, write the
Python statements to openthe following files:
a) a text file “example.txt” in both read and write mode
b) a binary file “bfile.dat” in write mode
c) a text file “try.txt” in append and read mode
d) a binary file “btry.dat” in read only mode
e) acsv file “names.csv” to search for a name.

5. Consider a csv file stock.csv containing (product id, description, rate) write function
for the following :
a) Add a new product to stock.csv
b) Display products whose rate is more then 50

SNDJA VIVEKANANDA VIDYALAYA SR SEC SCHOOL
– 2022-2023
Std : XII Max Marks :
70
Subject : Computer Science Time : 3 hrs
General Instructions :
(i) This question paper contains two parts Part A and B. Each part is compulsory.
(ii) Both Part A and Part B have choices.
(iii) Part A has two sections :
a. Section I is short answer questions, to be answered in one word or one line.
b. Section II has two case study-based questions. Each case study has 5 case-based
subparts. An examinee is to attempt any 4 out of the 5 subparts.
(iv) Part B is Descriptive Paper.
(v) Part B has three sections :
a. Section I is short answer questions of 2 marks each in which two questions have
internal options.
b. Section II is long answer questions of 3 marks each in which two questions have
internal options.
c. Section III is very long answer questions of 5 marks each in which one question
has an internal option.
(vi) All programming questions are to be answered using Python Language only.

PART A
Section I (15x1=15)
Select the most appropriate option out of the options given for each question. Attempt
any 15 questions from questions no. 1 to 21.

Section II (2 x 4 =8)
Both the case study-based questions are compulsory. Attempt any 4 sub-parts from
each question. Each question carries 1 mark.

Part – B
Section – 1: (10 x 2 =20)

Section – II (4 x 3 =12

Section III (3 x 5=15)




VIVEKANANDA EDUCATIONAL SOCIETY

Std :XI QUARTERLY EXAMINATION –2024-2025 Time : 3 Hrs


Subject : Computer Science Max. Marks:70

BLUE PRINT

SL.NO UNIT 1 mark 2 mark 3 mark 4 mark 5 mark Total


1 Computer system and 1x1=1 1x2=2 *(1)
1x4=4 2x5=10 17
Organisation
2 Basics of Python 5x1=5 2x2=4*(1) 9
3 Data Types 5x1=5 1x2=2 7
4 Operators and 5x1=5 1x2=2 2x3=6 *(1)
13
Expression
5 Flow of control 2x1=2 2x2=4*(1) 3x3=9 1x4=4 1x5=5 24
Total 18 14 15 8 15 70
* Internal choice

You might also like