Sobes.tech
Intern — Middle

Reading a file without using the with statement

livecode

Task condition

Rewrite the given code fragment by explicitly opening and closing the file manually, without using the context manager with. The program's logic should remain unchanged.

file = open('text.py', 'r')
print(file.read())
file.close()
Reading a file without using the with statement… - sobes.tech