Possible bug?


#1



https://www.codecademy.com/courses/ruby-beginner-en-1o8Mb/3/3?curriculum_id=5059f8619189a5000201fbcb#


Syntax is correct, but it always goes to the else. Why when I type python does it not catch at the python case? (Same for the other languages.)


puts "What's your favorite language?"
language = gets.chomp

case language
when language == "Ruby" then
  puts "Ruby is great for web apps!"
when language == "Python" then
  puts "Python is great for science."
when language == "JavaScript" then
  puts "JavaScript makes websites awesome."
when language == "HTML" then
  puts "HTML is what websites are made of!"
when language == "CSS" then
  puts "CSS makes websites pretty."
else
  puts "I don't know that language!"
end


#2

This is the expression that when is matching.

case language
  when "Ruby"
    puts "Ruby is great for web apps!"

and so on.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.