1.

Correct syntax of file.writelines() is?(a) file.writelines(sequence)(b) fileObject.writelines()(c) fileObject.writelines(sequence)(d) none of the mentioned

Answer» Right answer is (c) fileObject.writelines(sequence)

The best I can explain: The method writelines() writes a sequence of strings to the file. The sequence can be any iterable object producing strings, typically a list of strings. There is no return value.

Syntax

Following is the syntax for writelines() method:

fileObject.writelines( sequence ).


Discussion

No Comment Found