Ruby - Operators and Expressions
Find the error in this Ruby code snippet:
if !true || false puts "Yes" else puts "No" end
if !true || false puts "Yes" else puts "No" end
! with true is valid and reverses it to false. The || operator is also valid here.!true is false, so condition is false || false, which is false. The else branch runs printing "No".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions