adplus-dvertising
frame-decoration

Question

How do you close a file object (fp)?

a.

close(fp)

b.

fclose(fp)

c.

fp.close()

d.

fp.__close__()

Posted under Python

Answer: (c).fp.close()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. How do you close a file object (fp)?