If you have two arrays, you can quickly combine their results into one:
x = [1, 2, 3] y = ["a", "b", "c"] z = x + y # w w w. j a va 2s . c o m p z
We're using p here instead of puts z.inspect.