Here is my work for Exercise 32.
1. Take a look at how you used (0..5) in the last for-loop. Look up Ruby’s “range operator” (.. and ...) online to see what it does.
Ruby’s range operator is used to loop through a collection of integers. (..) is inclusive of the first and last element, (…) is exclusive of the last element.
(first_number..last_number).each do |number|
The above code will print the range from the first_number to the last_number.
2. Change the first for number in the_count to be a more typical .each style loop like the others.
3. Find the Ruby documentation on arrays and read about them. What other operations can you do besides the push function? Try <<, which is the same as push but is an operator. fruits << x is the same as fruits.push(x).
Here is the Ruby documentation on arrays. You can also sort arrays, reverse arrays, replace specific elements.. etc. The << append operation pushes the given object on to the end of the array. We can use fruits.push(new_fruit) to add new fruit elements to our fruits array. I added the code below to the end of the script.