<filename>Python Scripts/lesson_69_shelve.py
import shelve

# with shelve.open('ShelfTest') as fruit:
fruit = shelve.open('lesson_69_shelftest')
fruit['orange'] = "a sweet, orange, citrus fruit"
fruit['apple'] = "good for making cider"
fruit['lemon'] = "a sour, yellow citrus fruit"
fruit['grape'] = "a small, sweet fruit growing in bunches"
fruit['lime'] = "a sour, green citrus fruit"

print(fruit["lemon"])
print(fruit["grape"])
fruit.close()

# print(fruit)

<filename>Python Scripts/lesson_69_shelve.py
import shelve

# with shelve.open('ShelfTest') as fruit:
fruit = shelve.open('lesson_69_shelftest')
fruit['orange'] = "a sweet, orange, citrus fruit"
fruit['apple'] = "good for making cider"
fruit['lemon'] = "a sour, yellow citrus fruit"
fruit['grape'] = "a small, sweet fruit growing in bunches"
fruit['lime'] = "a sour, green citrus fruit"

print(fruit["lemon"])
print(fruit["grape"])
fruit.close()

# print(fruit)

# with shelve.open('ShelfTest') as fruit: # print(fruit)