1.

Which function is used to read single line from file?(a) Readline()(b) Readlines()(c) Readstatement()(d) Readfullline()The question was posed to me by my college director while I was bunking the class.This question is from Files in division Regular Expressions and Files of Python

Answer»

The CORRECT choice is (b) Readlines()

To explain: The readline function reads a SINGLE LINE from the file FH = open(“filename”, “r”)

CONTENT = fh.readline().



Discussion

No Comment Found

Related InterviewSolutions