Complete the code below by deleting "The Silmarillion" from the "The Lord of the Rings" series, so that the length of the list stored as a value would be equal to three.
Shelve
Making changes in a persistent dictionary
Report a typo
Write a program in Python 3
lib = shelve.open("my_library", writeback=False)
lib["Divergent trilogy"] = ["Divergent", "Insurgent", " Allegiant"]
lib["The Lord of the Rings"] = ["The Fellowship of the Ring", "The Two Towers", "The Return of the King", "The Silmarillion"]
# write your code here
print(len(lib["The Lord of the Rings"]))
lib.close()
___
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.