Last active
June 15, 2018 03:16
-
-
Save AkiraBrand/92f5c208a583871c846b4c339a2d3cdb to your computer and use it in GitHub Desktop.
Day 2 Ruby and Interactive Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What command is entered into the command line to enter an 'irb' session? | |
To enter an "irb" session (which stands for "Interactive Ruby", simply open your terminal on your Mac and type "IRB" | |
What is the expression used to express a number squared? | |
To express a number squared, type in x**2. This tells the calculator to take the number, in this case x, to the power of the number immediately following the two "*" signs. | |
What is the ruby command used to output something to the terminal? | |
puts "" | |
How is a ruby file run from the command line? | |
using irb, a program that runs ruby code as you type it in. The command to execute is "ruby your_program.rb" | |
If a # is at the beginning of a ruby line in Atom, what does that indicate? | |
It indicates a comment section, and it will be ignored by the computer. | |
What will "turing".length return? | |
6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment