ruby empty array

# Step 1: Declare an empty array named 'empty_array'
empty_array = []

# Step 2: Verify the empty array by checking its length
puts "Is the array empty? #{empty_array.empty?}"  # Output: Is the array empty? true

# Step 3: Add elements to the array
empty_array << 10
empty_array << "Hello, World!"
empty_array << true

# Step 4: Verify the array's contents and length after adding elements
puts "Array contents: #{empty_array}"            # Output: Array contents: [10, "Hello, World!", true]
puts "Array length: #{empty_array.length}"         # Output: Array length: 3

# Step 5: Access and print individual elements of the array
puts "First element: #{empty_array[0]}"            # Output: First element: 10
puts "Second element: #{empty_array[1]}"           # Output: Second element: Hello, World!
puts "Third element: #{empty_array[2]}"            # Output: Third element: true