Programming For Everybody: 1. Intro To Ruby
Programming For Everybody: 1. Intro To Ruby
Everybody
1. Intro to Ruby
Puts & Prints
Two commands we use to print info to the
console
PRINT
prints to the console whatever you give it
PUTS
prints to the console whatever you give it and
adds a new blank line below
Data Types
1. STRINGS
words or sentences
always go within “ “
2. NUMBERS
integers (whole numbers) and floats (decimal numbers)
shouldn’t be wrapped with “ “
3. BOOLEANS
true or false
shouldn’t be wrapped with “ “
Variables
A word to which we assign a certain content (string,
number, boolean)
Addition +
Subtraction -
Multiplication *
Division /
Exponentiation **
Modulo %
Built in methods
“Special behaviour” Ruby data has that we can summon
https://ruby-doc.org/core-2.5.3/Method.html
name = “Mariana”
GETS
Gets input from the user and ads a blank line after each input
CHOMP
Removes that extra line
Thank you! :)