Recap lesson 1 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!

For these exercises, we're only going to use IRB.

Remember: To run IRB, open a command line window (Powershell or Terminal). Then enter the command irb and press Enter.

To exit a running IRB, enter the command exit.

  1. You have two strings: ​"Ruby is"​ and ​"great!"​. Combine them to one string which says: ​"Ruby is great!". Figure out how to concatenate strings using the official documentation or using Google.

  2. Strings and numbers are two different things. The string ​"42"​ and the number ​42​ are not the same.
    1. You can ask any object what class it belongs to, by using the ​.class​ method. What does it say for the string ​"42"​ and the number ​42​?
    2. Find out how you can turn the number ​42​ into the string ​"42"​. How can you make a number out of a string?
  3. How can you turn the string ​"what is happening?"​ into ​"?gnineppah si tahW"​?