Computer Science Class XII Python File Handling Test Series Part 1

Computer Science Class XII Python File Handling Test Series Part 1

Q1. Name two types of data files available in python.

Q2. In text file each line is terminated by a special character called _______

Q3. In python, default EOL character is _______

Q4. Is there any delimiter of line in binary File?

Q5. In binary files, data stored in the same format as it is stored in computer memory. (T/F)

Q6. Processing of binary file is faster than text file (T/F)

Q7. Writing data is same as appending data in file. (T/F)

Q8. Can we read file without opening. (T/F)

Q9. Which function is used to open a file?

Q10. Write the code in python to open a file named "try.txt"


SOLUTIONS

Q1. Name two types of data files available in python.

Ans. Text File and Binary File

Q2. In text file each line is terminated by a special character called _______

Ans. EOL (End of Line)

Q3. In python, default EOL character is _______

Ans. \n

Q4. Is there any delimiter of line in binary File?

Ans. No

Q5. In binary files, data stored in the same format as it is stored in computer memory. (T/F)

Ans. True

Q6. Processing of binary file is faster than text file (T/F)

Ans. True

Q7. Writing data is same as appending data in file. (T/F)

Ans. False

Q8. Can we read file without opening. (T/F)

Ans. False

Q9. Which function is used to open a file?

Ans. open()

Q10. Write the code in python to open a file named "try.txt"

Ans. f = open("try.txt")

No comments:

Post a Comment

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet