Ruby conditionals Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are conditional statements?

A

Conditional statements are structures that run code if conditions are met.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the unless conditional?

A

The unless conditional is a method that runs if the conditional is not true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are compounded conditionals

A

It is when you add multiple conditionals with

| | or &&

How well did you know this?
1
Not at all
2
3
4
5
Perfectly