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!”.
Shelve
Context manager usage
Report a typo
Write a program in Python 3
# write your code here
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.