dictionnary lua

-- Step 1: Create a table to serve as a dictionary
local dictionary = {}

-- Step 2: Add key-value pairs to the dictionary
dictionary["apple"] = "a fruit with a red or green skin and a crisp texture"
dictionary["banana"] = "a long curved fruit with a yellow skin"
dictionary["orange"] = "a round citrus fruit with a tough bright orange skin"

-- Step 3: Access and print the definition of a specific word
local wordToLookup = "banana"
local definition = dictionary[wordToLookup]
print("Definition of " .. wordToLookup .. ": " .. definition)

-- Step 4: Update the definition of a word in the dictionary
local updatedDefinition = "a long curved fruit with a yellow skin, often eaten as a snack"
dictionary["banana"] = updatedDefinition

-- Step 5: Access and print the updated definition of the word
definition = dictionary[wordToLookup]
print("Updated definition of " .. wordToLookup .. ": " .. definition)

-- Step 6: Remove a word from the dictionary
local wordToRemove = "orange"
dictionary[wordToRemove] = nil

-- Step 7: Check if a word exists in the dictionary
local wordToCheck = "orange"
if dictionary[wordToCheck] then
    print(wordToCheck .. " exists in the dictionary.")
else
    print(wordToCheck .. " does not exist in the dictionary.")
end