12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications рооро┐ройрпНройрогрпБ родро░ро╡рпБ рокро░ро┐рооро╛ро▒рпНро▒роорпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications рооро┐ройрпН - ро╡рогро┐роХ рокро╛родрпБроХро╛рокрпНрокрпБ роЕроорпИрокрпНрокрпБроХро│рпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications рооро┐ройрпНройрогрпБ роЪрпЖро▓рпБродрпНродро▓рпН роорпБро▒рпИроХро│рпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications рооро┐ройрпН - ро╡рогро┐роХроорпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications родро┐ро▒роирпНрод роорпВро▓ роХро░рпБродрпНродрпБро░рпБроХрпНроХро│рпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications ро╡ро▓рпИропроорпИрокрпНрокрпБ ро╡роЯрооро┐роЯро▓рпН Sample Question Papers Study Material - QB365 Set A

Published on: 22/08/2026
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
In csv.register_dialect(), Which of the following parameter is used for removing whitespaces?
removespace
skipinitialspace
skipspace
removeinitialspace
2.
The file extension of Excel:
exl
xls
cel
Ecl
3.
Making some changes in the data of the existing file or adding more data is called
Editing
Appending
Modification
Alteration
4.
Which of the following creates an object which maps data to a dictionary?
listreader()
reader()
tuplereader()
DictReader ()
5.
What is the output of the following program?
import csv
d=csv.reader(open('cPYPRG\chl3\city.csv'))
next(d)
for row in d:
print(row)
if the file called city.csv" contain the following details
chennai, mylapore, mumbai, andheri
chennai, mylapore
mumbai,andheri
chennai
mumba
chennai,mylapore
mumbai,andheri
6.
Which of the following is a string used to terminate lines produced by writer() method of csv module?
Line Terminator
Enter key
Form feed
Data Terminator
7.
The command used to skip a row in a CSV file is
next()
skip()
omit()
bounce()
8.
Which of the following mode is used when dealing with non-text files like image or exe files?
Text mode
Binary mode
xls mode
csv mode
9.
The expansion of CRLF is
Control Return and Line Feed
Carriage Return and Form Feed
Control Router and Line Feed
Carriage Return and Line Feed
10.
A CSV file is also known as a __________
Flat File
3D File
String File
Random File
11.
Differentiate writer() and writerow() method.
12.
What is dialect?
13.
Why python has a garbage collector?
14.
How will you sort more than one column from a csv file? Give an example statement.
15.
What is use of next() function?
16.
Mention the default modes of the File.
17.
Mention the two ways to read a CSV file using Python.
18.
What is CSV File?
19.
Write a program to create a new normal CSV file to store data.
20.
What are the different ways of reading a CSV file using reader() method?
21.
How csv.write() function is used to create a normal CSV file in Python?
22.
What is the difference between reader() method and DictReader() class?
23.
What is the difference between the write mode and append mode.
24.
Write a Python program to read a CSV file with default delimiter comma (,).
25.
Write a Python program to modify an existing file.
26.
Write a note on open() function of python. What is the difference between the two methods?
27.
Write the rules to be followed to format the data in a CSV file.
28.
Write a Python program to write a CSV File with custom quotes.
29.
Write the different methods to read a File in Python.
30.
Tabulate the different mode with its meaning.
31.
Differentiate Excel file and CSV file.
1.
(b)
skipinitialspace
2.
(b)
xls
3.
(c)
Modification
4.
(d)
DictReader ()
5.
(b)
mumbai,andheri
6.
(a)
Line Terminator
7.
(a)
next()
8.
(b)
Binary mode
9.
(d)
Carriage Return and Line Feed
10.
(a)
Flat File
11.
writer() | writerow() |
The csv.writer ( ) function returns a writer object which converts the user's data into delimited strings on the given file-like object. | The writerow ( ) function writes a row of data into the specified file. |
12.
A dialect is a class of csv module which helps to define parameters for reading and writing CSV. It allows to create, store, and re-use various formatting parameters for data.
13.
Python has a garbage collector to clean up unreferenced objects but, one must not rely on it to close the file.
14.
To sort by more than one column you can use itemgetter with multiple indices: operator .itemgetter (1,2).
Syntax :
sortedlist = sorted(data,key =operator.itemgetter(Col_number),reverse-True)
Example : sortedlist = sorted (data, key operator.itemgetter(1))
15.
(i) The next() function returns the next item from the iterator.
(ii) It can also be used to skip a row of the csv file.
16.
The default modes of the file reading is text mode, while reading from the file the data would be in the format of strings.
17.
There are two ways to read a CSV file.
(a) Use the csv module's reader function
(b) Use the DictReader class.
18.
(i) A CSV file is a human readable text file where each line has a number of fields, separated by commas or some other delimiter.
(ii) ACSV file is also known as a Flat File.
19.
Import csv
csvData = [['Student'; 'Age'], ['Dhanush', '17'], [('Kalyani', '18'], ['Ram', '15']]
with open('c:\\pyprg\\ch13\\Pupil.csv', 'w', newline'=') as CF:
writer = csv.writer(CF) # CF is the file object
writer.writerows(csvData) # csvData is the List name
CF.close()
20.
(i) CSV file data with default delimiter comma (,)
(ii) CSV file - data with Space at the beginning
(iii) CSV file - data with quotes
(iv) CSV file - data with custom Delimiters
21.
The csv.writer() function returns a writer object which converts the user's data into delimited strings on the given file-like object. The writerow() method writes a row of data into the specified file.
The syntax for csv.writer() is
csv.writer(fileobject,delimiter.fmtparams) where
fleobject: passes the path and the mode of the file
delimiter: an optional parameter containing the standard dialects like , | etc can be omitted
fmtparams: optional parameter which help to override the default values of the dialects like skipinitialspace, quoting etc. can be omitted.
You can create a normal CSV file using writer() function of csv module having default delimiter Comma (,).
22.
(i) The main difference between the csv. reader() and DictReader() is in simple terms csv. reader and csv.writer work with list/tuple, while csv.DictReader and csv.DictWriter work with dictionary.
(ii) csv.DictReader and csv.DictWriter take additional argument fieldnames that are used as dictionary keys.
23.
The w' write mode creates a new file. If the file is already existing 'w mode overwrites it. Where as 'a append mode is used to add the data at the end of the file if the file already exists otherwise creates a new one.
24.
#import csv
import csv
#opening the csv file which is in different location with read mode
with open('c:\\pyprg\\samplel.csv', 'r')as F:
#other way to open the file is f=('c:\\pyprg\samplel.csv', 'r')
reader = csv.reader(F)
#printing each line of the Data row by row
for row in reader:
print(row)
Fclose()
Output :
['SNO', 'NAME', 'CITY']
('12101', 'RAM', 'CHENNAI']
['12102', 'LAVANYA', 'TIRUCHY']
['12103', 'LAKSHMAN', 'MADURAI']
25.
import csv
row = ['3', ;Meena','Bangalore']
with open('student.csv', 'r', newline'=') as readFile:
reader = csv.reader(readFile)
lines = list(reader) # list()- to store each row of data as a list
lines[3]= row
with open('student.csv', 'w') as writeFile:
# returns the writer object which converts the user data with delimiter
writer = cSV.Writer(writeFile)
#writerows()method writes multiple rows to a csv file
writer.writerows(lines)
readFile.close()
writeFile.close()
26.
Python has a built-in function open() to open a file. This function returns a file object, also called a handle, as it is used to read or mnodify the file
accordingly.
Method 1
f= open("test.txt")
f.close()
Method 2
with open("test.txt";r) as f:
Best way is using with statement to open files, so they are automatically closed. This ensures that the file is closed when the block inside with is exited.
27.
Rules to be followed to format data in a CSV file :
(i) Each record (row of data) is to be located on a separate line, delimited by a line break by pressing enter key.
Example:
XX,yyyтЖ▓
тЖ▓ denotes enter Key to be pressed
(ii) The last record in the file may or may not have an ending line break.
Example:
PPP, qqqтЖ▓
yyy, xxx
(iii) There may be an optional header line appearing as the first line of the file with the same format as normal record lines. The header will contain names corresponding to the fields in the file and should contain the same number of fields as the records in the rest of the file.
Example:
field_namel,field_name2,field_name3тЖ▓
aaa,bbb,cccтЖ▓
zzz,yyy,xxx CRLF(Carriage Return and Line Feed)
(iv) Within the header and each record, there may be one or more fields, separated by commas. Spaces are considered part of a field and should not be ignored. The last field in the record must not be followed by a comma. For example: Red, Blue
(v) Each field may or may not be enclosed in double quotes. If fields are not enclosed with double quotes, then double quotes may not appear inside the fields.
Example:
"Red","Blue","Green" #Field data with double quotes
Black,White,Yellow #Field data without double quotes
(vi) Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.
Example:
Red, "," Blue CRLF
Red, Blue, Green # comma itself is a field value. so it is enclosed with double quotes
(vi) If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be preceded with another double quote.
Example:
""Red"", ""Blue"", ""Green"" CRLF # since double quotes is a field value it is enclosed with another double quotes.
28.
import csv
csvData = [['SNO','Items'], ['1', 'Pen'], ['2','Book'], ['3', 'Pencil']]
csv.register_dialect(myDialect, delimiter = Bquotechar = "quoting=csv.QUOTE_ALL)
with open('c:\\pyprgl \chl3\\quote.csv, w) as csvFile: writer= csv.writer(csVFile, dialect-myDialect')
writer, write rows(csvData)
print("writing completed")
csvFile.close( )
When you open the "quote.csv" file in notepad, we get following output:
SNO | "Items" |
|---|---|
1 | "Pen" |
2 | "Book" |
3 | "Pencil" |
In the above program, myDialect uses pipe () as delimiter and quotechar as doublequote " " to write inside the file.
29.
Read a CSV File Using Python :
There are two ways to read a CSV file.
(i) Use the csv module's reader function
(ii) Use the DictReader class.
CSV Module's Reader Function :
(i) You can read the contents of CSV file with the help of csv.reader() function. The reader function is designed to take each line of the file and make a list of all columns.
(ii) Using this function one can read data from csv files of different formats like quotes (""), pipe (|) and comma (,).
The syntax for csv.reader() is csv.reader(fileobject,delimiter,fmtparams)
where
(iii) file object : passes the path and the mode of the file
(iv) delimiter: an optional parameter containing the standard dialects like, | etc can be omitted.
(v) fmtparams: optional parameter which help to override the default values of the dialects like skipinitialspace, quoting etc. can be omitted.
Program :
#importing csv
import csv
with open(c:\pyprg\samplel.csv','r,newline'=') as F:
reader = csv.reader(F)
for row in order
print(row)
Fclose()
Output :
['SNO', 'NAME', 'CITY']
['12101', 'RAM', 'CHENNAI']
['12102', 'LAVANYA', 'TIRUCHY']
['12103', 'LAKSHMAN', 'MADURAI']
Reading CSV File Into A Dictionary :
(i) To read a CSV file into a dictionary can be done by using DictReader method of csv module which works similar to the reader() class but creates an object which maps data to a dictionary.
(ii) The keys are given by the fieldnames as parameter. DictReader works by reading the first line of the CSV and using each comma separated value in this line as a dictionary key. The columns in each subsequent row then behave like dictionary values and can be accessed with the appropriate key (i.e. fieldname).
For Example Reading "sample8.csv" file into a dictionary
import csv
filename = 'c:\pyprglsample8.csv'
input_file =csv.DictReader(open(filename:r'))
for row in input_file:
print(dict(row)) #dict() to print data
Output :
{'ItemName': 'KeyboardQuantity': '48'}
{'ItemName': 'Monitor', 'Quantity': '52'}
{'Item Name': 'Mouse','Quantity': '20'}
30.
Mode | Description |
|---|---|
'r' | Open a file for reading. (default) |
'w' | Open a file for writing. Creates a new file if it does not exist or truncates the file if it exists. |
'x' | Open a file for exclusive creation. If the file already exists, the operation fails. |
'a' | Open for appending at the end of the file without truncating it. Creates a new file if it does not exist. |
't' | Open in text mode. (default) |
'b' | Open in binary mode. |
'+' | Open a file for updating (reading and writing) |
31.
Excel | CSV |
|---|---|
Excel is a binary file that holds information about all the worksheets in a file, including both content and formatting | CSV format is a plain text format with a series of values separated by commas. |
XLS files can only be read by applications that have been especially written to read their format, and can only be written in the same way. | CSV can be opened with any text editor in Windows like notepad, MS Excel, OpenOffice, etc. |
Excel is a spreadsheet that saves files into its own proprietary format viz. xls or xlsx | CSV is a format for saving tabular information into a delimited text file with extension .csv |
Excel consumes more memory while importing data | Importing CSV files can be much faster, and it also consumes less memory |
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications роХро│рокрпНрокрпЖропро░рпН роорпБро▒рпИроорпИ (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications ро╡ро▓рпИропроорпИрокрпНрокрпБ роОроЯрпБродрпНродрпБроХрпНроХро╛роЯрпНроЯрпБроХро│рпН рооро▒рпНро▒рпБроорпН роирпЖро▒ро┐роорпБро▒рпИроХро│рпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications роХрогро┐ройро┐ ро╡ро▓рпИропроорпИрокрпНрокрпБ роУро░рпН роЕро▒ро┐роорпБроХроорпН Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-роЙроЯройрпН MySQL-роР роЗрогрпИродрпНродро▓рпН Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards