21. Correct syntax of file.writelines() is? A. file.writelines(sequence) B. fileObject.writelines() C. fileObject.writelines(sequence) D. none of the mentioned Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
22. Which is/are the basic I/O connections in file? A. Standard Input B. Standard Output C. Standard Errors D. All of the mentioned Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
23. What is the use of "a" in file handling? A. Read B. Write C. Append D. None of the mentioned Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
24. Which are the two built-in functions to read a line of text from standard input, which by default comes from the keyboard? A. Raw_input & Input B. Input & Scan C. Scan & Scanner D. Scanner Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
25. How can you check the current position in a file in Python? A. By using the tell() method on a file object B. By using the position() method C. By using the current_position() method D. By using the get_position() method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
26. How can you check if a file exists in Python before opening it? A. By using the os.path.exists() function B. By using the file.exists() method C. By using the file.is_existing() method D. By using the file.exist() method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
27. Which function is used to read single line from file? A. Readline() B. Readlines() C. Readstatement() D. Readfullline() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
28. Which of the following are the modes of both writing and reading in binary format in file? A. wb+ B. w C. wb D. w+ Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
29. To read the entire remaining contents of the file as a string from a file object infile, we use . . . . . . . . A. infile.read(2) B. infile.read() C. infile.readline() D. infile.readlines() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
30. Which function is used to read all the characters? A. Read() B. Readcharacters() C. Readall() D. Readchar() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board