Ruby conditionals Flashcards
1
Q
What are conditional statements?
A
Conditional statements are structures that run code if conditions are met.
2
Q
What is an if statement?
A
An if statement is a structure that runs if the given statement is true, otherwise it runs the else statement.
if conditional [then] run some_code elsif conditional [then] run some_code else run some_code end
3
Q
What is the unless conditional?
A
The unless conditional is a method that runs if the conditional is not true
4
Q
What are compounded conditionals
A
It is when you add multiple conditionals with
| | or &&