Question #623

In the code snippet below, what is "open"?
with open("testfile.txt") as file:  
    data = file.read()

open() is simply a function. with is a context manager. (pythonforbeginners.com/cheatsheet/python-file-handling#:~...)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵