Python - Context Managers
Consider this code:
What will be printed before the program stops?
class Logger:
def __enter__(self):
print('Log start')
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_type:
print(f'Error: {exc_val}')
print('Log end')
with Logger() as log:
print('Running')
1 / 0What will be printed before the program stops?
