Week 1 - Ruby Introduction Flashcards
Keywords
Words which have specific meaning or complete a special function in a programming language.
def
Used to define a method
end
Closes off the defintion of a method
What does calling a method mean?
Executes the method (things between def and end)
Prints a string of data, and doesn’t add a new line after executing.
puts
Prints a string of data, and adds a new line after executing.
gets
Requests a string of data to be used. (Enter your name here: )
String
A line of characters stored within quotations “…”
Integers
Whole numbers
Real/Float
Floating decimal point numbers
Booleans
True or false
Variables
A piece of data that we declare and is part of the computer’s memory which can be called on later.
Constant
A given value which will never change throughout the code
+ Signs
They are based on the context of data.
Can represent addition if there are integers.
Can also represent putting 2 strings together if strings.
Logic Error
An error made often due to typos