Context manager usage

Report a typo

Your task is to open "my_library" using a context manager and add a new book. Use “Anna Karenina” as the key and the string “Happy families are all alike; every unhappy family is unhappy in its own way...” as a value. Then print “A new book has been added to the library!”.

Write a program in Python 3
# write your code here
___

Create a free account to access the full topic