5. When and Then


#1



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


My code is technically passing, but when I enter the "approved" languages (i.e. English, French, etc.), every response I get in the console is my else statement saying, "I don't know that language!". Is this a bug, or have I done something wrong?


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

# Add your case statement below!
case greeting
when "English" then puts "Hello!"
when "French" then puts "Bonjour!"
when "German" then puts "Guten Tag!"
when "Finnish" then puts "Haloo!"
else puts "I don't know that language!"
end.


#2

The variable should be the same in both statements.

greeting = gets.chomp

#3

That's awesome, it worked. I appreciate it.


#4

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