CBSE Class 12 Computer Science CSV File MCQs

Refer to CBSE Class 12 Computer Science CSV File MCQs provided below. CBSE Class 12 Computer Science MCQ questions with answers are available for download in Pdf. The MCQ Questions for Class 12 Computer Science with answers are aligned as per the latest syllabus and exam pattern suggested in Class 12 by CBSE, NCERT and KVS. Multiple Choice Questions for CSV File are an important part of exams for Class 12 Computer Science and if practiced properly can help you to improve your understanding of CSV File and get higher marks. Refer to more Chapter-wise MCQs for CBSE Class 12 Computer Science and also download more latest study material for all subjects

MCQ for Class 12 Computer Science CSV File

Class 12 Computer Science students should refer to the following multiple-choice questions with answers for CSV File in Class 12.

CSV File MCQ Questions Class 12 Computer Science with Answers

Question. Observe the following code and fill the blank in statement3
import csv
with _________ as f: #statement1
r = csv.______(f) #statement2
for row in ______: #statement3
print(_____) #statement4
a) F
b) r
c) r,f
d) None of the above

Answer : B

Question. To open a file c:\scores.csv for reading, we use _______ command.
a) infile = open(“c:\scores.csv”, “r”)
b) infile = open(“c:\\scores.csv”, “r”)
c) infile = open(file = “c:\scores.csv”, “r”)
d) infile = open(file = “c:\\scores.csv”, “r”)

Answer : B

Question. To read the entire content of the CSV file as a nested list from a file object infile, we use __________ command.
(a) infile.read()
(b) infile.reader()
(c) csv.reader(infile)
(d) infile.readlines()

Answer : C

Question. State True/False:
The CSV files only take comma as delimiter.
a) True
b) False

Answer : B

Question. Observe the following code and fill the blank in statement2
import csv
with _________ as f: #statement1
r = csv.______(f) #statement2for row in ______: #statement3
print(_____) #statement4

a) load
b) read()
c) reader()
d) readlines()

Answer : C

Question. The default delimiter character of CSV file is____.
a) : (colon)
b) \t (tab)
c) , (comma)
d) ; (semi-colon)

Answer : C

Question. The CSV files are ____ files.
a) Text
b) Binary
c) Data
d) Python

Answer : A

Question. State True/False :
(i) The csv files are Binary Files:
a) True
b) False

Answer : B

Question. Observe the following code and fill the blank in statement1
import csv
with _________ as f: #statement1
r = csv.______(f) #statement2
for row in ______: #statement3
print(_____) #statement4

a) open(“data.csv”)
b) f=open(“data.csv”)
c) Both A & B are Correct
d) Both A & B are incorrect

Answer : A

Question. The full form of CSV is
a) Comma Separated Values
b) Comma Separated Value
c) Comma Separated Variables
d) Comma Separate Values

Answer : A

Question. State True/False:
A CSV file is open in the same way as text file.
a) True
b) False

Answer : A

Question. The file mode to open a CSV file for reading as well as writing is _____.
a) a+
b) w+
c) r+
d) All the above.

Answer : C

Question. State True/False :
The separator character of csv files is called delimiter.
a) True
b) False

Answer : A

Question. The CSV files are popular because they are
a) capable of storing large amount of data
b) easier to create
c) preferred export and import format for databases and spread sheets
d) All the above

Answer : D

Question. The file mode to open a CSV file for appending as well as reading is _____.
a) a+
b) w+
c) r+
d) All the above.

Answer : A

Question. Which of the following statement(s) are true for csv files?
a) When you open a file for reading, if the file does not exist, an error occurs
b) When you open a file for writing, if the file does not exist, a new file is created
c) When you open a file for writing, if the file exists, the existing file is overwritten with the new file
d) All the above

Answer : D

Question. EOL character used in windows operating system in CSV file is
a) \r
b) \n
c) \r\n
d) \0

Answer : C

Question. Which of the following is not a valid mode to open CSV file?
a) a
b) w
c) ab
d) r

Answer : C

Question. Observe the following code and fill the blank in statement4
import csv
with _________ as f: #statement1
r = csv.______(f) #statement2
for row in ______: #statement3
print(_____) #statement4
a) r
b) row
c) f
d) csv

Answer : B
 

CSV file: import csv module, open / close csv file, write into a csv file using csv.writerow() and read from a csv file using csv.reader( )

Question. The file mode to open a csv file for appending as well reading is ……..
a) w
b) w+
c) a
d) a+

Answer : D

Question. The character that separates values in csv files is called the ………
a) delimit
b) delimiter
c) delimited
d) delimits

Answer : B

Question. To add data to an existing csv file, the mode of the file should be ……..
a) w
b) w+
c) a
d) a+

Answer : C

Question. Every record in a CSV file is stored in reader object in the form of a list using which method?
a) writer()
b) append()
c) reader()
d) list()

Answer : C

Question. The file mode to open a csv file for reading as well writing is ………
a) r
b) rw
c) r+
d) rb

Answer : C

Question. CSV stands for …….
a) Cursor Separated Variables
b) Comma Separated Values
c) Cursor Separated Values
d) Cursor Separated Version

Answer : B

Question. To specify a different delimiter while writing into csv file, ……. argument is used with csv.writer().
a) delimit
b) delimiter
c) delimited
d) delimits

Answer : B

Question. The default delimiter of csv file is ……………
a) comma
b) colon
c) semicolon
d) hyphen

Answer : A

Question. Which module is used for working with CSV files in Python?
a) random
b) statistics
c) csv
d) math

Answer : C

Question. To cancel the EOL translation in csv file while writing the data ………… argument is used with open().
a) newline
b) next
c) open
d) EOL

Answer : A

CASE STUDY QUESTIONS (R)

Krishna of class 12 is writing a program to read the details of Sports performance and store in the csv file “Sports.csv” delimited with a tab character. As a programmer, help him to achieve the task.
import ___________ # Line 1
f = open(“Sports.csv”,”a”)
wobj = csv.______________ (f, delimiter = „\t‟) # Line 2
wobj.writerow( [„Sport‟, „Competitions‟, „Prizes Won‟] )
ans = „y‟
i = 1
while ans == „y‟:
print(“Record :”, i)
sport = input(“Sport Name :”)
comp = int(input(“No. of competitions participated :”))
prize = int(input(“Prizes won:”))
record = ____________________ # Line 3
wobj.______________ (rec) # Line 4
i += 1
ans = input(“Do u want to continue ? (y/n) :”)
f.___________ # Line 5

Question. Name the module he should import in Line 1
a) .tcs
b) .tmp
c) .bin
d) .csv

Answer : D

Question. To create a sequence of user data in Line 3
a) [prize,comp,sport]
b) [comp,prize,sport]
c) [sport, comp, prize]
d) none of the above

Answer : C

Question. To create an object to enable to write in the csv file in Line 2
a) open
b) writer
c) file
d) read

Answer : B

Question. To write a record onto the writer object in Line 4
a) write
b) writerow
c) writeline
d) writelines

Answer : B


Deepesh works as a programmer with Delta Technologies. He has been assigned the job of generating the salary of all employees using the file “employee.csv”. He has written a program to read the CSV file “employee.csv” which will contain details of all the employees. He has written the following code. As a programmer, help him to successfully execute the given task.
import______ # Line 1
def readCsvEmp( ): # to read data from the CSV file
with ______(’employees.csv’, newline=”) as f: # Line 2
reader = csv.______ (f) # Line 3
data_list = ______(reader) # Line 4
______ (data_list) # Line 5

Question. Name the module he should import in Line 1.
a) import csv
b) csv import
c) import
d) export csv

Answer : A

Question. Fill in the blank in Line 3 to read the data from a csv file.
a) read
b) readline
c) reader
d) writer

Answer : C

Question. Write the method that he should use to open the file to read data from it.
a) read
b) open
c) close
d) append

Answer : B

Question. Fill in the blank in Line 4 with the method to convert the data read from the file into list.
a) list
b) sets
c) dictionary
d) tuple

Answer : A


Kumar is writing a program to create a CSV file “student.csv” which will contain rollno, name and age of some students. He has written the following code. As a programmer, help him to successfully execute the given task
import ________________ # Line 1
f=open(‘student.csv’,’w’,newline=””)
p=csv._________(f) # Line 2
ch=’y’
while ch==’y’:
l=[]
rollno=int(input(‘enter rollno’))
name=input(‘enter name’)
age=int(input(‘enter age’))
l.append(rollno)
l.append(name)
l.append(age)
p.___________(l) # Line 3
ch = input (‘want to continue y/n?’)
if ch==’y’:
continue
else:
break
f.__________()
f=open(‘student.csv’,’r+’)
c=list(csv.reader(f))
for i in c:
k=i[2]
if int(k)>15:
print(i)
f.close()

Question. Name the module he should import in Line 1
a) import csv
b) csv import
c) import
d) export csv

Answer : A

Question. The method which is to be used in line 3 to writes a row of data into the specified file
a) p.writerow(l)
b) p.writerows(l)
c) p.writer()
d) p.writerow(l)

Answer : D

Question. which function is used in Line 2 to create a writer object
a) p=tsv.writer(f)
b) p=psv.writer(f)
c) p=csv.writer(f)
d) p=dsv.writer(f)

Answer : C

Question. Fill in the blank in Line 4 to close the file.
a) f.close()
b) f.open()
c) close.f()
d) f.read()

Answer : A


Legend sports wanted to store the number of prizes for each sport as a SPORTS.CSV file. As a programmer help them to complete the task successfully.
import _______________ #Line 1
fh=___________________ # Line 2
swriter = ______________(fh) #Line 3
ans=‟y‟
i=1
while ans==‟y‟:
print(“Record”,i)
sport=input(“Sport name”)
prizes=int(input(“Enter prizes won”))
__________ # Line 4
i=i+1
ans=input(“Want to enter records”)
fh._________________#Line 5

Question. Name the module to be imported in Line 1.
a) .tsv
b) .csv
c) .py
d) .bin

Answer : B

Question. Write the correct statement to write the data into file in line 3.
a) writerows( )
b) writerow( )
c) writer( )
d) swriter = csv.csvwriter(fh)

Answer : D

Question. Fill in line 2 to open the CSV file.
a) fh = open(“sports.csv”,”w”)
b) fh=read(“sports.csv”,”w”)
c) fh = file(“sports.csv”,”w”)
d) fh = append(“sports.csv”,”w”)

Answer : A

Question. Write the statement to write the records given as input from user in line 4.
a) swriter([sport,prizes])
b) swriter.writrrow([sport,prizes])
c) swriter_writrrow([sport,prizes])
d) swriterwritrrow([sport,prizes])

Answer : B


Puneeta is storing the data of her gift store in a csv file named gift.csv which will store Gift_code and Gift_name of items of her gift store. She has written the following code .As a programmer help her to successfully execute her program in python:
import ___________ # Line 1
def writeFile(Gift_code,Gift_name):
F=open(“gift.csv”,‟___‟) #Line 2
FW=csv.________(F) #Line 3
FW.writerow([Gift_code,Gift_name)
F.close()
#CSV file for reading
def readFile():
with ________(„gift.csv‟,‟r‟) as newF #Line 4
FR=csv.reader(newF)
for row in FR:if row[0]==101:
print(row)
newF.close()
writeFile(101,”Photoframe”)
writeFile(102,”Soft Toys”)
writeFile(103,”Flower Pot”)
readFile() #Line 5

Question. Name the module she should import in line 1.
a) .tmp
b) .bin
c) .tsc
d) .csv

Answer : D

Question. Fill in the blanks in Line 3 to write data to csv file gift.csv
a) close()
b) open()
c) writer()
d) append()

Answer : C

Question. In which mode Puneeta should open the file to add data in it?
a) “a”
b) “ab”
c) “r”
d) “w”

Answer : A

Question. Fill in the blank in Line 4 to open the csv file from the disk
a) close
b) open
c) write
d) read

Answer : B

More Study Material

CBSE Class 12 Computer Science CSV File MCQs

We hope students liked the above MCQs for CSV File designed as per the latest syllabus for Class 12 Computer Science released by CBSE. Students of Class 12 should download the Multiple Choice Questions and Answers in Pdf format and practice the questions and solutions given in above Class 12 Computer Science MCQs Questions on daily basis. All latest MCQs with answers have been developed for Computer Science by referring to the most important and regularly asked topics which the students should learn and practice to get better score in school tests and examinations. Studiestoday is the best portal for Class 12 students to get all latest study material free of cost.

MCQs for Computer Science CBSE Class 12 CSV File

Expert teachers of studiestoday have referred to NCERT book for Class 12 Computer Science to develop the Computer Science Class 12 MCQs. If you download MCQs with answers for the above chapter daily, you will get higher and better marks in Class 12 test and exams in the current year as you will be able to have stronger understanding of all concepts. Daily Multiple Choice Questions practice of Computer Science and its study material will help students to have stronger understanding of all concepts and also make them expert on all critical topics. After solving the questions given in the MCQs which have been developed as per latest course books also refer to the NCERT solutions for Class 12 Computer Science designed by our teachers

CSV File MCQs Computer Science CBSE Class 12

All MCQs given above for Class 12 Computer Science have been made as per the latest syllabus and books issued for the current academic year. The students of Class 12 can refer to the answers which have been also provided by our teachers for all MCQs of Computer Science so that you are able to solve the questions and then compare your answers with the solutions provided by us. We have also provided lot of MCQ questions for Class 12 Computer Science so that you can solve questions relating to all topics given in each chapter. All study material for Class 12 Computer Science students have been given on studiestoday.

CSV File CBSE Class 12 MCQs Computer Science

Regular MCQs practice helps to gain more practice in solving questions to obtain a more comprehensive understanding of CSV File concepts. MCQs play an important role in developing understanding of CSV File in CBSE Class 12. Students can download and save or print all the MCQs, printable assignments, practice sheets of the above chapter in Class 12 Computer Science in Pdf format from studiestoday. You can print or read them online on your computer or mobile or any other device. After solving these you should also refer to Class 12 Computer Science MCQ Test for the same chapter

CBSE MCQs Computer Science Class 12 CSV File

CBSE Class 12 Computer Science best textbooks have been used for writing the problems given in the above MCQs. If you have tests coming up then you should revise all concepts relating to CSV File and then take out print of the above MCQs and attempt all problems. We have also provided a lot of other MCQs for Class 12 Computer Science which you can use to further make yourself better in Computer Science

Where can I download latest CBSE MCQs for Class 12 Computer Science CSV File

You can download the CBSE MCQs for Class 12 Computer Science CSV File for latest session from StudiesToday.com

Can I download the MCQs of CSV File Class 12 Computer Science in Pdf

Yes, you can click on the links above and download topic wise MCQs Questions PDFs for CSV File Class 12 for Computer Science

Are the Class 12 Computer Science CSV File MCQs available for the latest session

Yes, the MCQs issued by CBSE for Class 12 Computer Science CSV File have been made available here for latest academic session

How can I download the CSV File Class 12 Computer Science MCQs

You can easily access the links above and download the CSV File Class 12 MCQs Computer Science for each topic

Is there any charge for the MCQs with answers for Class 12 Computer Science CSV File

There is no charge for the MCQs and their answers for Class 12 CBSE Computer Science CSV File you can download everything free

How can I improve my MCQs in Class 12 Computer Science CSV File

Regular revision of MCQs given on studiestoday for Class 12 subject Computer Science CSV File can help you to score better marks in exams

What are MCQs for Class 12 Computer Science CSV File

Multiple Choice Questions (MCQs) for CSV File Class 12 Computer Science are objective-based questions which provide multiple answer options, and students are required to choose the correct answer from the given choices.

Why are CSV File important for Class 12 students?

Learning CSV File based MCQs will help students improve their overall understanding of important concepts and topics and help to score well in Class 12 Computer Science exams.

How can I practice CSV File for CBSE Class 12?

You can practice CSV File for CBSE Class 12 through worksheets, textbooks and online quizzes provided by studiestoday.com.

Where can I find CBSE Class 12 Computer Science CSV File MCQs online?

You can find CBSE Class 12 Computer Science CSV File MCQs on educational websites like studiestoday.com, online tutoring platforms, and in sample question papers provided on this website.

How can I prepare for CSV File Class 12 MCQs?

To prepare for CSV File MCQs, refer to the concepts links provided by our teachers and download sample papers for free.

Are there any online resources for CBSE Class 12 Computer Science CSV File?

Yes, there are many online resources that we have provided on studiestoday.com available such as practice worksheets, question papers, and online tests for learning MCQs for Class 12 Computer Science CSV File

Can I find CBSE Class 12 Computer Science CSV File practice worksheets online?

Yes, you can find printable CSV File worksheets for CBSE Class 12 Computer Science on studiestoday.com.

How can I get more free MCQs with answers for CBSE Class 12 Computer Science CSV File MCQs?

We have provided full database of free multiple choice questions with answers on studiestoday.com for CBSE Class 12 Computer Science CSV File