Which method out of the following is used to write a line of content in a CSV…

2023

Which method out of the following is used to write a line of content in a CSV file in a Python program?

  1. A.

    writer

  2. B.

    writerow

  3. C.

    write

  4. D.

    writeline

Attempted by 2189 students.

Show answer & explanation

Correct answer: B

In the csv module, writerow() writes one complete row (as a list/tuple) to a CSV file.

Explore the full course: Rssb Senior Computer Instructor