16What is the main advantage of with open('f.txt') as f:?AIt reads fasterBIt opens in binary modeCThe file is closed automatically, even if an error occursDIt locks the fileView AnswerDiscussWorkspaceReportSaveEasy
17What happens when you open a non-existent file in 'r' mode?AFileNotFoundError is raisedBAn empty file is createdCNone is returnedDIt waitsView AnswerDiscussWorkspaceReportSaveEasy
18Which mode opens a file for writing and creates it (erasing old contents if it exists)?A'w'B'a'C'x'D'r'View AnswerDiscussWorkspaceReportSaveEasy
19What does 'rb' mean in open(path, 'rb')?ARead buffered textBRead in binary modeCRead and blankDRead backwardsView AnswerDiscussWorkspaceReportSaveEasy
20What is the output of the following code?import io f = io.StringIO('hello\nworld\n') print(f.readline().strip(), f.readline().strip())Ahello helloBworld helloChello worldDErrorView AnswerDiscussWorkspaceReportSaveEasy