Complete the code to check if both conditions are true using the AND operator.
if a [1] b puts "Both are true" end
The AND operator in Ruby is &&. It returns true only if both sides are true.
Complete the code to check if either condition is true using the OR operator.
if x [1] y puts "At least one is true" end
The OR operator in Ruby is ||. It returns true if at least one side is true.
Fix the error in the code by completing the NOT operator usage.
if [1] is_valid puts "Invalid input" end
The NOT operator in Ruby is !. It reverses the truth value of the expression.
Fill both blanks to create a condition that checks if a is true AND b is false.
if a [1] [2]b puts "Condition met" end
Use && to check both conditions and ! to negate b.
Fill all three blanks to create a condition that checks if x is true OR y is false AND z is true.
if x [1] [2]y [3] z puts "Complex condition met" end
Use || for OR, ! to negate y, and && for AND.
