Exercise 22 Flashcards
puts
put string
Prints a string onto the screen. Includes newline character at the end.
Prints a string onto the screen.
Doesn’t include newline character at the end.
””
double quotes.
Tell Ruby to interpret what’s within the characters as Ruby code.
#
octothorpe or pound symbol. Turns lines of code into comments.
{}
format activator. Tells Ruby to interpolate its contents as code
variable
A name that holds a piece of information.
+
plus operator. Used for addition. Can add numbers or combine strings.
-
minus operator. Used for subtraction.
/
slash operator. Used for division.
*
asterik operator.
Used for multiplication. Can multiply numbers or strings. Two asteriks together will find a number’s exponent.
%
percent.
Can be used as a modulus operator. It finds the remainder after division.
*>
less than.
Comparison operator. Checks to see if an item is less than another.
>
greater than. Comparison operator. Checks to see if an item is greater than another.
<=
less than or equal to. Comparison operator. Checks if an item is less than another. Also checksif the item is equal to the other.
=>
greater than or equal to. Comparison operator. Checks if an item is greater than another.Also checks if the item is equal to the other.
=
assignment operator.
Assigns values to a variable.
.
decimal.
Turns numbers into floats. Also used to call methods on variables.
”
single quotes.
Create strings. Won’t do string interpolation.
true
boolean value.