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.
Which of the following is an array holding the command line arguments of the program?
g++
argv
Opts
Getopt
2.
Which of the following is needed to run a C++ program on windows?
m++
g++
ghre++
f++
3.
The module which allows you to interface with the Windows operating system is
OS module
sys module
csv module
getopt module
4.
CSV is expanded as:
Comma Separated Values
Condition Separated Values
Comma Special Values
Condition Special Values
5.
A CSV file is also known as a __________
Flat File
3D File
String File
Random File
6.
Write the syntax of getopt.getopt method.
7.
Write is purpose of using skipinitialspace parameter.
8.
Differentiate writer() and writerow() method.
9.
Write the expansion of (i) SWIG (ii) MinGW
10.
Differentiate compiler and interpreter.
11.
How will you sort more than one column from a csv file? Give an example statement.
12.
What is use of next() function?
13.
List the commonly used python interfaces.
14.
What are the applications of scripting language?
15.
Write about the steps of Python program executing C++ program using control statement.
16.
What is sys.argv? What does it contain?
17.
What is MinGW? What is its use?
18.
What is the difference between the write mode and append mode.
19.
Write a Python program to modify an existing file.
20.
Discuss the features of Python over C++.
21.
Write a Python program to execute the following c++ coding
#include <iostream>
using namespace std;
int main()
{ cout<<"WELCOME";
return(0);
}
The above C++ program is saved in a file welcome.cpp
22.
Write a Python program to write a CSV File with custom quotes.
23.
Write the different methods to read a File in Python.
1.
(b)
argv
2.
(b)
g++
3.
(a)
OS module
4.
(a)
Comma Separated Values
5.
(a)
Flat File
6.
<opts>,<args> = getopt.getopt(argy, options, [long options]).
7.
In dialects the parameter "skipinitialspace" is used for removing whitespaces after the delimiter. By default "skipinitialspace" has a value false. The default is False.
8.
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. |
9.
(i) SWIG - Simplified Wrapper Interface Generator.
(ii) MINGW тАУ Minimalist GNU for Windows
10.
Compiler | Interpreter | |
|---|---|---|
(i) | A compiler takes a program as a whole. | An interpreter takes single lines of a code. |
(ii) | Error deduction is difficult. | Error deduction is easy. |
(iii) | Comparatively faster. | lower. |
(iv) | Example : C++ | Example : Python |
11.
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))
12.
(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.
13.
The commonly used interfaces are
(i) Python-C-API(API-Application Programming Interface for interfacing with C programs)
(ii) Ctypes (for interfacing with c programs)
(iii) SWIG (Simplified Wrapper Interface Generator- Both C and C++)
(iv) Cython (Cython is both a Python-like language for writing C-extensions)
(v) Boost. Python (a framework for interfacing Python and C++)
(vi) MinGW (Minimalist GNU for Windows)
14.
Applications of Scripting Languages :
1. To automate certain tasks in a program
2. Extracting information from a data set
3. Less code intensive as compared to traditional programming language
4. can bring new functions to applications and glue complex systems together.
15.
Step 1: Type the c++ program in notepad and save it as with .cpp extension.
Step 2: Type the python program and save it as with .py extension
Step 3: Click the Run Terminal and open the command window
Step 4: Type the command python <program_ name.py> -i <c++ program>
16.
(i) sys.argv is the list of command-line arguments passed to the Python program.
(ii) argv contains all the items that come along via the command-line input.
(iii) The first argument, sys.argv[0] contains the name of the python program (example pali.py)
(iv) sys.argv [1]is the next argument passed to the program.
17.
(i) MinGW refers to a set of runtime header files, used in compiling and linking the code of C, C++ and FORTRAN to be run on Windows Operating System.
(ii) MinGw-W64 (version of MinGW) is the best compiler for C++ on Windows.
MinGW allows to compile and execute C++ program dynamically through Python program using g++.
18.
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.
19.
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()
20.
Features of Python over C++:
(i) Python uses Automatic Garbage Collection whereas C ++ does not.
(ii) C ++ is a statically typed language, while Python is a dynamically typed language.
(iii) Python runs through an interpreter, while C ++ is pre-compiled.
(iv) Python code tends to be 5 to 10 times shorter than that written in C ++.
(v) In python, there is no need to declare types explicitly where as it should be done in C ++
(vi) In python, a function may accept an argument of any type, and return multiple values without any kind of declaration beforehand. Whereas in C ++ return statement can return only one value.
21.
#Now select File тЖТ New in Notepad and type the Python program as main.py
# Program that compiles and executes a .cpp file
# Python main.py -i welcome
import sys, os, getopt
def main(argv):
cpp_file =''
exe_file = "
opts, args = getopt.getopt(argv, "i:"['ifile='])
for o, a in opts:
if o in ("-i", "--ifle"):
cpp_file =a+'.cpp'
exe file=a+'.exe'
run(cpp_file, exe_file)
def run(cpp_file, exe_file):
print("Compiling " + cpp_file)
Os.system('g++ cpp_ file +'-o'+exe_ file)
print("Running" + exe_file)
print("-------------------------'')
Os.system(exe_file)
if__name__=='__main__':
main(sys.argv[1:])
Output :
___________
Welcome
_________
22.
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.
23.
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'}
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