Computer Science

Which of the following is the correct syntax of file object 'fobj' to write sequence data type using writelines() function?

  1. file.writelines(sequence)
  2. fobj.writelines()
  3. fobj.writelines(sequence)
  4. fobj.writeline()

Python Data Handling

2 Likes

Answer

fobj.writelines(sequence)

Reason — The syntax for a file object to write sequence data using the writelines() function is fileobject.writelines(sequence). Therefore, fobj.writelines(sequence) is correct.

Answered By

3 Likes


Related Questions