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: 13/05/2022
QB365 provides detailed and simple solution for every book back questions in class 12 Computer Science subject.It will helps to get more idea about question pattern in every book back questions with solution.
latest Book back QuestionsDownload 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.
What is the difference between reader() and DictReader() function?
2.
What is the difference between the write mode and append mode.
3.
Write a Python program to read a CSV file with default delimiter comma (,).
4.
Write a Python program to modify an existing file.
5.
Write a note on open() function of python. What is the difference between the two methods?
1.
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. csv. DictReader and csv. DictWriter take additional argument fieldnames that are used as dictionary keys.
2.
Write mode:
Open a file for writing. Creates a new file if it does not exist or truncates the file if it exists.
Append mode:
Open for appending at the end of the file without truncating it. Creates a new file if it does not exist.
3.
Program: To read a csv file with comma (,)
#importing csv
import csv
#opening the csv file which is in different location with read mode
with open('c:\\Pyprg\ \sample1.csv', 'r') as F:
#other way to open the file is
f=('C:\\pyprg\\sample1.csv', 'r')
reader = csv.reader(F))
#printing each line of the Data row by row.
print (row)
F. close( )
Output:
['SNO','NAME', 'CITY']
['12101', 'RAM', 'CHENNAI']
['12102', 'LAVANYA' "TIRUCHY']
['12103', 'LAKSHMAN', 'MADURAI']
4.
Program: To modify an existing file
import csv
row = ['3: 'Meena','Bangalore']
with open('Student.csv', 'r') as read file:
reader = csv.reader (read File)
lines = list (reader)
lines [3] = row
with open ('Student.csv', 'w') as write file:
# 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()
Output:
| Roll No | Name | City |
| 1. | Harshini, | Chennai |
| 2. | Adhith, | Mumbai |
| 3. | Meena, | Bangalore |
| 4. | Egiste | Tiruchy |
| 5. | Venkat, | Madurai |
5.
(i) 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 modify the file accordingly.
For Example:
>>>f = open ("sample.txt") #open file in current directory # f is file object
>>> f = open ('c:\\Pyprg\ch13 sample5.csv') # specifying full path
(ii) The default is reading in text mode. In this mode, while reading from the file the data would be in the format of strings.
(iii) On the other hand, binary mode returns bytes and this is the mode to be used when dealing with non-text files like image or exe files.
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