You are on page 1of 17

VIGNESH INTERNATIONAL SCHOOL

TIRUVANNAMALAI
Class : XII Time Allowed : 3 HRS
Subject : (083) Computer Science Maximum Marks : 70

General instructions:
 The paper is divided into 3 Sections- A, B and C.
 Section A, consists of Question number 1 to 25 and student need to attempt 20 questions.
 Section B, consists of Question number 26 to 49 and student need to attempt 20 questions.
 Section C, consists of Question number 50 to 55 and student need to attempt 5 questions.
 All questions carry equal marks (0.77 mark per question).

Section – A
Section A consists of 25 questions, attempt any 20 questions

1. Which of the following statement is incorrect?


A. X=*Y 5. Negative index -1 belongs to ______ of string.
B. My_name = ’Deepesh’ A. first character
C. While = 400 B. second character
D. None of these C. second last character
D. last character
2. Consider a declaration L = (35)
Which of the following represents the datatype 6. What will be the output of the following code
of L? segment?
A. Tuple Lst=['KV', 'is', 'the', 'best', 'school', 'in', 'India']
B. List print(Lst[ : : 4])
C. Integer
D. Dictionary A. [‘KV’, ‘is’,’the’,’best’]
B. [‘KV’, ‘best’, ‘India’]
3. Which of the following is not used to repeat C. ['KV', 'School']
some code in Python? D. [‘KV’, ‘is’,’the’, ‘best’,’school’]
A. for loop
B. do-while loop 7. Which of the following is a Python tuple?
C. while loop A. (11, ‘is’, ‘my’, ‘class’)
D. None of the above. B. {11, ‘is’, ‘my’, ‘class’}
C. (11, is, ‘my’, ‘class’]
4. The _________ statement terminates the D. {}
execution of the whole loop.
8. Which of the following is/are features of list?
A. continue A. List is mutable
B. break B. List is a sequence data type.
C. breake C. List[: : -1] prints reverse of the list
D. exit D. All of the above

1| – -
9. Which of the following functions will return the 15. What is the use of “w” in file handling?
key, value pairs of a dictionary? A. Read
A. keys() B. Append
B. values() C. Write
C. items() D. None of the mentioned
D. all of these
16. Write full form of csv:
10. Choose correct answer A. Comma settled values
t=['Marks', 'of', 'Yash', [34, 43, 41, 38]] B. Common separated values
print(t[: : -1]) C. Comma separated values
A. [[38, 41, 43, 34], 'Yash', 'of', 'Marks'] D. None of the above
B. [[34, 43, 41, 38], 'Yash', 'of', 'Marks']
C. [[38, 41, 43, 34], 'hsaY', 'fo', 'skraM'] 17. Which function is used to save data in binary
D. [[83, 14, 34, 43], 'hsaY', 'fo', 'skraM'] files?
A. Load()
11. Predict the output of the following code: B. dumb()
def myFunc(n1, n2): C. load()
for x in range(n1, n2): D. dump()
if n1%x==0:
print(x, end=' ') 18. Which statements are true about the blocks in
myFunc(10, 20) exception handling?
A. Exception is raised in try
A. 10 12 14 16 18 20 B. Exception is handled in except
B. 12 16 20 C. The statements written within finally block
C. 10 20 are always executed regardless of whether an
D. 10 exception occurred in try block or not.
D. All of these
12. Which of the following is not a python
functions type: 19. Which of the following statement opens a binary
A. Module function file record.bin in write mode and writes data
B. User-defined function from a list lst1 = [1, 2, 3] on the binary file?
C. Random function A. with open('record.bin','wb') as myfile:
D. Built-in-function pickle.dump(lst1,myfile)
B. with open('record.bin','wb') as myfile:
13. The extension of text file is ____, and extension pickle.dump(myfile,lst1)
of python code file is ______. C. with open('record.bin','rb') as myfile:
A. .txt, .pyt pickle.dump(myfile,lst1)
B. .py, .txt D. with open('record.bin','ab') as myfile:
C. .pyt, .text pickle.dump(myfile,lst1)
D. .txt, .py
20. Alankar wants to check whether her name is
14. When reading a file using the file object, which listed in list.dat or not. Which command he can
method is best for reading the entire file into a write to open the file:
single string? A. a=open(“list.dat”,”rb”)
A. readline() B. with open (“list.dat’,’rb”) as a:
B. read() C. None
C. READ() D. Both a and b
D. readlines()
21. To write data into binary file which mode will 23. The CSV files can be operated by___ software.
be used? A. Spreadsheet
A. wb B. Notepad
B. r+ C. MS Excel
C. rb D. All of the above
D. w+
24. Which of the following is not a function/
22. Syntax for opening student.csv file in write method of csv module in Python?
mode is A. reader()
myfile = open("student.csv", "w", newline=''). B. read()
What is the importance of newline=' ' ? C. writer()
D. writerow()
A. A newline gets added to the file
B. Empty string gets appended to the first line. 25. Most commonly used software for opening csv
C. Empty string gets appended to all lines. file in windows is:
D. EOL translation is suppressed A. Acrobat Reader
B. Microsoft word
C. Microsoft Excel
D. Google Chrome

Section – B
Section B consists of 24 questions, attempt any 20 questions.

26. Write the output of the following: 28. Given list1 = [10, 20, 30, 40, 50]
name = ['Nischay', 'Manoj', 'Nirbhaya', 'Nilu'] Statement 1: list1[: : -1]
print(max(name)) Statement 2: list1.reverse()
Which statement modifies the contents of
A. Manoj original list1.
B. Nilu A. Statement 1
C. Nirbhaya B. Statement 2
D. Nischay C. Both Statement 1 and 2.
D. None of the mentioned
27. Read the code given below and answer the
question: 29. What will be the output when the following code
f=open(“sample.txt”,’w’) is executed?
f.write(“Morning”) >>> str1="Nitin”
f.close() >>> str1[: : -1]
A. nItIN
B. Nitin
If the file contains “Good” before execution, C. nitiN
what will be the contents of the file after D. NiTiN
execution of this code?
30. Find output of the following code:
A. Good Morning for I in range (15, 9, -2):
B. Good print(I, end=’ ‘)
C. Morning A. 15 13 11
D. None of these B. 15 13 11 9
C. 15 14 13 12 11 10 9
D. 15 14 13 12 11 10

3
31. What will be the output of the following code 35. What is the output of "hello" +str(123+321)?
segment?
l=list(range(100,20,-20)) A. hello123321
print(l) B. hello444
A. [100, 80, 60, 40] C. Error
B. [100, 80, 60, 40] D. hello132231
C. [100, 20, -20]
D. Error 36. Consider the following code and choose correct
answer:
32. Choose the correct code to write one record of def nameage(name, age):
student (Rno, Name, Gender, Marks) in binary return [age, name]
file named mybinary.dat? t=nameage(“Kanak Sharma”, 20)
print(type(‘t’))
A. fileobject=open(“mybinary.dat”, ”wb”)
B. fileobject=open(“mybinary.dat”, ”wb”) A. tuple
pickle.dump(listvalues, fileobject) B. list
C. import pickle C. (‘Kanak Sharma’,20)
listvalues=[1,”Prabal” ‘M’, 16] D. string
fileobject=open(“mybinary.dat”, ”wb”)
pickle.dump(listvalues, fileobject) 37. What is the output of the program given
D. import pickle below?
listvalues=[1,”Prabal” ‘M’, 16] >>> def myFunc(x):
fileobject=open(“mybinary.dat”, ”wb”) L=[k for k in range(0, x ,2)]
pickle.dump(listvalues, fileobject) print(L*2)
fileobject.close( ) >>> myFunc(5)

33. Find the output of the following code: A. [ 0, 2, 4, 0, 2, 4 ]


>>> L1=[25,65,85,47] B. [ 0, 4, 8 ]
>>> L2=(L1) C. Both A and B
>>> L1[2]=100 D. Error because we cannot multiply List
>>> print(L1,'\t',L2)
A. [25, 65, 100, 47] [25, 65, 85, 47] 38. Based on the below code, What maximum value can
B. [25, 65, 85, 47] [25, 65, 85, 47] be assigned to FROM and minimum value can be
C. [25, 65, 100, 47] [25, 65, 100, 47] assigned to TO.
D. [25, 65, 85, 47] [25, 65, 100, 47]
import random
34. What is the output of the program given below? AR = [20, 30, 40, 50, 60, 70]
a = 100 FROM = random.randrange(1, 3)
def func (a) : TO = random.randrange(2, 4)
a = 20 for K in range(FROM, TO+1):
func (a) print(AR[K], end=’#’)
print (' a is now ', a)
A. 2, 3
A. a is now 50 B. 2, 2
B. a is now 100 C. 3, 2
C. a is now 2 D. 2, 1
D. error

4| -
A. 0
39. Choose correct output for the following code B. 2
def check(x, y): C. 1
if x != y:
D. 3
return x+5
else:
return y+10 42. You have given a file 'teacher.txt'
print(check(10, 5))
I am a student of class XII. My best teacher
A. 15 is Mr. P. Singh. He is very nice person. He
B. 20 teaches me CS and IP. I respect him very
C. 5 much. Every student love him.
D. 10

40. You have given a file 'school.txt'. The content is What will be the output of the following code?
infile = open("teacher.txt")
I read in class XII. My school name is KV. x = infile.read()
I like very much. I live in India b = x.count('is') + x.count(‘very’)
print(b)
What will be the output of the following code? infile.close()
infile = open("school.txt")
x = infile.read() A. 2
y = x.count('in') B. 3
print(y) C. 4
infile.close() D. 5

43. Which function reads some bytes from the text


A. 2
file and returns it as a string?
B. 3 A. read()
C. 4 B. readline()
D. 5 C. readlines()
D. readall( )
41. Consider the code given below and identify how
many times the message “all the best” will be 44. Write the output for the below code:
printed
def prog(name): def mysum(a=100, b=200, c=300):
for x in name: return (a+b+c)
if x.isalpha():
print(“alphabet”) p, q , r=10, 20, 30
elif x.isdigit():
print(“digit”) print(mysum(p, r), '\t', mysum())
elif x.isupper():
print(“upper”) A) 60 600
else: B) 350 600
print(“all the best”) C) 340 600
D) 330 600
prog(“ramesh143@kvsrojaipuronline.in”)

5| -
45. Consider the below statement 47. Choose the correct option for mode
Data=F.read(10). file1=open("notes.txt", )
Which of the following statement is True ch=file1.read()
regarding variable Data? print(ch)
file1.close()
A. Data contains list of 10 lines
B. Data contain list of 10 characters A. w
C. Data contains string of 10 characters B. a
D. Data contains integer value 10 C. r
D. All of the above

46. You have given a file 'book.txt' 48. Consider the below code snippet and write the
missing part in statement4
myfile = open("student.txt") #Statement1
My KV is best in the world
data_rec = myfile.read() #Statement2
print(data_rec) #Statement3
What will be the output of the following code?
myfile._______ #Statement4
myfile = open("book.txt")
A. close
str = myfile.read()
B. close( )
size = len(str.split())
C. closed
print(size)
D. closed()
myfile.close()
49. Write the output of the following:
A. 26 a=(1, 2, 3, 2, 3, 4, 5)
B. 18 print(min(a) + max(a) + a.count(2))
C. 22
D. 7 A. 13
B. 6
C. 8
D. Error

6| -22
Section – C
Section C consists of 06 questions, attempt any 05 questions.
Raj Kuntal is collecting data of criminal persons and the
prize money on them with their location. He is 51. Which symbol is missing in Line 2?
storing/retrieving data from a file CRIMINAL.CSV. It A. ::
consists some records (sno, name, money, location). He B. ,
has written the following code in python. As a C. @
programmer, you have to help him to successfully D. :
execute the program.
52. Which statement will be written at Line 4?
A. f.close
import ___________ # Line 1 B. obj.close()
def addRecord(Lst) # Line 2 C. f.close()
f=open(“CRIMINAL.CSV”, ___ ) # Line 3 D. obj.close
obj=csv.writer(f)
obj.writerow(Lst) 53. Which function to be used in Line 5 to read the
_______ # Line 4 data from a csv file.
A. read()
def ShowRecord(): B. readline()
with open(“CRIMINAL.CSV”, ”r”) as file: C. readlines()
obj=csv.___________(file) # Line 5 D. reader()
for rec in obj:
print(rec[0], “#”, rec[2]) 54. The output after executing Line 6 will be :
A. 1#Jaipur
Criminal_1=[1,’XYZ’, 500, ‘Jaipur’] 2#Bharatpur
Criminal_2=[2,’PQRYZ’, 1500, ‘Bharatpur’] B. 1#500
2#1500
addRecord(Criminal_1) C. XYZ#500
addRecord(Criminal_2) PQRYZ#1500
ShowRecord() # Line 6 D. XYZ#Jaipur
PQRYZ#Bharatpur

50. Which module should be imported in Line 1? 55. Which file mode to be passed to add new record
A. pickle in Line 3?
B. csv A. a
C. file B. w
D. text C. w+
D. wb

7| – -
----------------------------------------------------------------------------------------------------------------------------------
Section- A
This section consists of 25 Questions (1 to 25). Attempt any 20 questions from this
section. Choose the best possible option.
--------------------------------------------------------------------------------------------------------------------------
1. Consider a list num = [5, 10, 15, 20], which of the following will result in an error:-
a) num[0] += 3 b) num += 3 c) num *= 3 d) num[1] = 45
2. Find the operator which cannot be used with a string in Python from the following:-
a) // b) * c) + d) in
3. Consider a tuple in python named Months = (‘Jul’, ‘Aug’, ‘Sep’). Identify the invalid
statement(s) from the given below statements:-
a)S = Months[0] b)print(Months[2])
c) Months[1] = ‘Oct’ d)LIST1 =list(Months)
4. Which if the following is not a feature of Python function:-
a) Modularity b) Simplicity
c) Reusability d) difficult to find error
5. Which is the correct dictionary declaration?
a)d1={1:'January',2='February',3:'March'} b)d2=(1:'January',2:'February',3:'March'}
c)d3={1:'January',2:'February',3:'March'} d)d4={1:January,2:February,3:March}
6. A Programmer is working in Python program which is function oriented. He/She is using
the functions already available in python. These functions are called:
a) User Defined Function b) Modular Function
c) In-built Function d) Reusable Function
7. What is the area of memory called, which stores the parameters and local variables of a
function call?
a)Heap b)Queue c)Stack d)Array
8. A void function also returns a ______________ value to its caller.
a) int b) String c) None d) Boolean
9. Sam wants to vote for the upcoming election because his age is below 18. A python code
is written to check his age .identify it is correct or incorrect.
Age=input(“enter age:”)
if age<=18:
print(“you are not eligible to Vote”)

a) Correct b)Incorrect
10. CSV stands for
a)Column Separated Values b)Comma Separated Values
c)Comma Started Values d)Column Separated Values
11.What would be the minimum and maximum value of z (random module has already
been imported)?
X=random(2,6)
Y= random(1,2)
Z=X+Y
print(Z)
a)min:1 max:2 b)min:2 max:6 c)min:3 max:8 d)min:1 max:8
12. What is the default mode of opening a file in python?
a)read b)write c)append d)read and write
13. Which of the following expressions is an example of type casting?
a)4.0+float(6) b)5.3+6.3 c)5.0+3 d)None of these
14. To read twelve characters from a file object f1, we use
a)f1.read(12) b)f1.read() c)f1.readline() d)read(f1,12)
15. In which of the following file modes, the existing data of file will not be lost?
a)wb+ b)wb c)rb d)w+
16. Which is NOT the possible output of following program from given options:

import random
periph = ['Mouse', 'Keyboard', 'Printer', 'Monitor']
for i in range(random.randint(0,2)):
print(periph[i],'*',end=" ")
(A) Mouse *Keyboard * (B) Mouse *Keyboard* Printer*
(C) Mouse * (D) No output
17. Which of the following is valid variable name:-
a)Student name b)3Number c)%name% d)Block_number
18. What will be the output after the following statements?
a = [0, 1, 2, 3]
del a[:]
print(a)

a)None b)[] c)[0, 1, 2, 3] d)NameError


19. What will be the output after the following statements?
x = 27
y = 19
while x < 30 and y > 15:
x=x+1
y=y-1
print(x,y)

a) 26 11 b) 25 11 c) 30 16 d) 26 10
20. What will the following code produce?
T=[‘kvs’,’rpr’]
T1=range(len(T))
for i in T1:
T[i]=T[i].upper()
print(T)

a)[‘KVS’,’rpr’] b)[‘kvs’,’rpr’]
[‘KVS’,’RPR’] [‘KVS’,’RPR’]
c)[‘Kvs’,’Rpr’] d)Error
[‘KVS’,’RPR’]
21. Find out the type of error if any-
if v <5:
print(“Hello World”)
else:
print(“Good to see you!”)

a) No Error b)Declaration of v
c): with else not required d)Indentation Error
22. Consider square numbers defined as follows:
compute(1) = 1
compute(N) = compute(N-1) + 2N-1

According to this definition, what is compute (3)?


a)compute(3) = compute(2) +compute(1) b)compute(3) = compute(2) -2*3+1
b)compute(3) = compute(2) + 2*3-1 d)compute(3) = compute(3) +2*3-1
23. When you open a file for adding more data, if the file does not exist, an error occurs.
a) True b)False
24. The relative path for a file always changes after changing the directory.
a) True b) False
25. The value of the expressions 4/(3*(4-2)) and 4/3*(4-2) is the same.
a) True b) False
--------------------------------------------------------------------------------------------------------------------------
Section B
This section consists of 24 Questions (26 to 49). Attempt any 20 questions.
----------------------------------------------------------------------------------------------------------------------------------------
26. Which of these about a dictionary is false?
a) The values of a dictionary can be accessed using keys
b) Dictionaries aren’t ordered
c) The keys of a dictionary can be accessed using values
d) Dictionaries are mutable
27. Identify the correct option to add new value 50 to existing tuple T
T = (11,22,33,44,55)
a)T = T + 66 b)T = T + 66 c)T = T + (66,) d)T = T + (66)
28.Find and write the output of the following python code:
a=10
def call():
global a
a=15
b=20
print(a)
call()
a)25 b)15 c)35 d)10
29.Which of the following Python codes will result in an error?
obj = ‘a’
a)pickle.dumps(obj) b)pickle.dumps(obj,3)
c)pickle.dumps(obj,3,True) d)pickle.dumps(‘a’,2)

30. What is the value called that is passed during the function call?
a) Argumentation b) Argument c)Parameter c) Keyword Argument
31. Evaluate the expression :
a = [5,4,3,2,2,2,1]
a=a [ a [ a [ a [ 0 ] + 1 ] ] ]
print(a)
a)3 b)4 c)5 d)2
32 What is the output of the following program :
print( 0.1 + 0.2 == 0.3)
a)True b)False c)Machine Dependent d)Error
33. What will be the output after the following statements?
x=4
y=8
while x + y < 20:
print(x, end=' ')
x += 2
a)0 2 4 6 b)4 6 8 10 c)0 2 4 6 d)0 2 4 8
34.
tie =’blue’
def dress():
shoe=’brown’

In above code tie is a ___________ variable while shoe is a ________variable.


a) Global, Local b) Global, Default c) Default, Local d)Dynamic, Local
35. Which of the following is the use of id() function in Python?
a) Id returns the identity of the object b) Every object doesn’t have a unique ID
c) All of the mentioned d) None of the mentioned
36. Suppose content of ‘data.txt' is
CBSE XII Examination
What will be the output of the following code?
fileread = open("data.txt")
x = fileread.read()
print(len(x))
fileread.close()
a)5 b)25 c) 26 d)20

37. Suppose content of 'India.txt' is


India is a secular country
What will be the output of the following code?
fileread = open("India.txt")
volist = list("aeiouAEIOU")
vc=0
x =fileread.read()
for y in x:
if y in volist:
vc+=1
print(vc)
fileread.close()

a) 10 b) 7 c) 8 d) 9
38. What will be the output of the following code?
tup1 = (1,2,[1,2],3)
tup1[2][1]=3.14
print(tup1)

a. (1,2,[3.14,2],3) b. (1,2,[1,3.14],3) c. (1,2,[1,2],3.14) d. Error Message


39. Assume the content of text file, 'student.txt' is:
Kaustubh
Pranav Kumar
Dilshad
Amrita

What will be the data type of filedata?


fileread = open(“student.txt")
filedata = fileread.readlines()
fileread.close()

a. string b. list c. tuple d. dictionary


40. Consider the following directory structure.
Computer Science

Python C++ Java SQL

Topic.txt Topic1.txt Topic2.txt Topic3.txt

Suppose root directory (Computer Science) and present working directory are the same. What will be
the absolute path of the file Topic.txt?

a) Computer Science/Topic.txt b) Computer Science/Python/Topic.txt


c) Computer Science/Python/…/Topic.txt d) Computer Science/C++/Topic.txt

41. Suppose content of 'Myfile.txt' is


Twinkle Twinkle little star
How I wonder what you are
Up above the world so high
Like a diamond in the sky
Twinkle Twinkle little star
What will be the output of the following code?
myfile = open("Myfile.txt")
line_count = 0
data = myfile.readlines()
for line in data:
if line[0] == 'T':
line_count += 1
print(line_count)
myfile.close()

a) 2 b) 3 c) 4 d) 5
42. What is the output of the following code snippet?
def ChangeVal(M,N):
for i in range(N):
if M[i]%5 == 0:
M[i]//=5
if M[i]%3 == 0:
M[i]//=3
L = [25,8,75,12]
ChangeVal(L,4)
for i in L:
print(i,end="#")
a) 5#8#15#4# b) 5#8#5#4# c) 5#8#15#14# d) 5#18#15#4#
43. Suppose content of 'quote.txt' is
Don’t stop until you are Proud.
What will be the output of the following code?
myfile = open("quote.txt")
record = myfile.read().split()
print(len(record))
myfile.close()

a) 4 b) 5 c) 6 d) 7

44. Evaluate the following expression and identify the correct answer.
18 - (1 + 2) * 5 + 2**5 * 4

a) 131 b) 146 c) 181 d) 132

45. Priya is trying to write a tuple num = (11,12,13,14,15) on a binary file number.bin.
Consider the following code written by him.
import pickle
num = (11,12,13,14,15)
fileread = open("number.bin",'wb')
pickle._______ #Statement 1
fileread.close()
Identify the missing code in Statement 1.
a) dump(fileread,num) b) dump(num, fileread)
c) write(num,fileread) d) load(fileread,num)

46. Identify the output of the following Python statements.


x = [[10, 11, 12],[13, 14, 15]]
y = x[0][1]
print(y)
a. 11 b. 13 c. 14 d. 15

47. Consider the following code:


import math, random
print(str(int(math.pow(random.randint(2,4),2))),end= ' ')
print(str(int(math.pow(random.randint(3,4),2))),end= ' ')
print(str(int(math.pow(random.randint(4,4),2))))
What could be the possible outputs out of the given four choices?

(a) 2 3 4 (b) 9 16 16 (c) 16 4 16 (d) 2 4 9


48. What is the output of the program given below:
import random
x = random.random()
y= random.randint(0,4)
print(int(x),”:”, y+int(x))

a) 0: 0 b) 2 : 4 c)1: 6 d) 0 : 5

49.
Assertion (A): Parameters with default arguments can be followed by parameters with no
default argument.
Reason (R): Syntactically, it would be impossible for the interpreter to decide which values
match which arguments if mixed modes were allowed while providing default arguments.
(a) A is true but R is false.
(b) A is false but R is true.
(c) Both A and R are false.
(d) Both A and R are true but R is not the correct explanation of A.
(e) Both A and R are true and R is the correct explanation of A.
------------------------------------------------------------------------------------------------------------------------
Section-C
(This section consists of 6 Questions (50 -55) Attempt any 5 questions.)
--------------------------------------------------------------------------------------------------------------
Rohan Pratap of class 12 is writing a program to create a CSV file “hobby.csv” which will
contain Name and hobby name for some entries. He has written the following code. As a
programmer, help him to successfully execute the given task.
import _________ # Line 1
def addCsvFile(Name,Hobby):
f=open(' hobby.csv','____') # Line 2
newFileWriter = csv.writer(f)
newFileWriter._________([Name,Hobby]) # Line 3
f.close()
def readCsvFile():
newFile = open(' hobby.csv','r')
newFileReader = csv.___________ (newFile) # Line 4
for row in newFileReader:
print (row[0], “@”, row[1])
newFile.___________ # Line 5
addCsvFile(“Pranav”, “Cricket”)
addCsvFile(“Sunaina”, “Badminton”)
addCsvFile(“Manish”, “Painting”)
readCsvFile() #Line 6

50. Name the module he should import in Line 1.


(a) pickle (b) csv (c) file (d) random
51. In which mode, Shubham should open the file to add data into the file.(Line 2)
(a) w+ (b) r (c) r+ (d) a
52. Fill in the blanks for Line 3 write the data to CSV file.
(a) writerow() (b) writerows() (c) Writerows() (d) writerRow()
53. Fill in the blank in Line 4 to read the data from a csv file.
(a) load() (b) read() (c) reader() (d) readline()
54. Fill in the blank in Line 5 to close the file..
(a) close() (b) Close() (c) CLOSE() (d) end()
55. Write the output he will obtain while executing Line 6.
(a) Pranav Cricket (c) Pranav @ Cricket
Sunaina Badminton Sunaina @ Badminton
Manish Painting Manish @ Painting
(b) “Pranav” “Cricket” (d) “Pranav” @ “Cricket”
“Sunaina” “Badminton” “Sunaina” @ “Badminton”
“Manish” “Painting” “Manish” @ “Painting”

*****************

You might also like