Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Operators and Control Structures Ruby Control Structures Else challenge

Patrick Burke
Patrick Burke
5,885 Points

I have been stuck for so long pls I just want the answer.

I don't like to cheat but somehow can't figure this out for the life of me.

ruby.rb
def check_speed(car_speed, speed_limit)
  # YOUR CODE HERE

end

1 Answer

I know how it is sometimes. Here you go.

def check_speed(car_speed, speed_limit)
  if car_speed > speed_limit
    puts "Slow Down!"
  else
    puts "Safe travels!"
  end 
end
Patrick Burke
Patrick Burke
5,885 Points

Thank you! I swear I did it that way before... It was such a simple problem. Thanks for the help.