Ranges Exercise

In case you get stuck anywhere, don't be afraid to ask the coaches! They are here to help and will gladly explain everything to you!

Take notes during the exercises. Even if you never look at them again, they will help you memorise things!

  1. Create a new file in your directory

  2. Create a range with the numbers from 1 to 40, without actually using the number 40 in your code

  3. Using a range method, find out what the first and the last item in the range is

  4. Check if the range includes the number 44

  5. Check the Ruby documentation for a method that returns the number of items in the range

  6. Increase all the numbers in your range by 2

  7. Finally, make an array out of your range

  8. Create another range with the characters c to u

  9. In the Ruby documentation, search for the method to find out the minimum value of your range

  10. What is the first and the last value of your range?

  11. Does your range include the character A?

  12. What can you learn from question 10?