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