Ruby - Control Flow
Find the error in this Ruby code snippet:
value = 15 case value in 10-20 then puts 'In range' else puts 'Out of range' end
value = 15 case value in 10-20 then puts 'In range' else puts 'Out of range' end
10-20 which is subtraction, not a range... for inclusive ranges, so it should be 10..20.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions