<Apti
Code
/>
Back
Question 486: How can you close a file in Python after performing operations on it?
tcs
wipro
infosys
general
aptitude
reading-and-writing-files
python-programming
To close a file in Python, you should use theclose()method on the file object.
file.close()
close_file(file)
file.end()
end_file(file)
Submit Answer
Show Answer
Previous
Next