if, elsif, else let you branch your code based on a condition. This is essential for things like checking a login, checking age, or checking whether something is in stock.
ruby
age = 20
if age < 18
puts "You are a minor."
elsif age >= 18 && age < 65
puts "You are an adult."
else
puts "You are a senior."
endRuby checks each condition from top to bottom. As soon as it finds a block that's true, it runs that block and skips the rest.
You should see
You are an adult.Info
&& means the result is true only if both conditions are true. || means the result is true if at least one condition is true.