Ruby - Control Flow
Find the error in this Ruby code snippet:
score = 85 case score when 90..100 puts "A" when 80..89 puts "B" when 70..79 puts "C" else puts "F" end
Why does it not print "B" for score 85?
Find the error in this Ruby code snippet:
score = 85 case score when 90..100 puts "A" when 80..89 puts "B" when 70..79 puts "C" else puts "F" end
Why does it not print "B" for score 85?
=== operator, which works with ranges to check if a value is inside.puts "B" will run correctly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions