A

Admin • 832.27K Points
Coach

Q. How can you write multiple lines to a file efficiently?

  • (A) write() with loop
  • (B) writelines()
  • (C) writeall()
  • (D) write_line()
  • Correct Answer - Option(B)
  • Views: 23
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

writelines() writes a list of strings to a file without adding newline characters automatically.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.