Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Operators and Control Structures Logical Operators The And (&&) Operator

Derrick Williams
PLUS
Derrick Williams
Courses Plus Student 1,075 Points

logical operators challenge

I'm not sure where i'm going wrong here

ruby.rb
def check_speed(car_speed)
  # write your code here
  if (car_speed > 39) && (car_speed <= 50)
    puts "safe"
 end

3 Answers

Hi Derick,

Great try and almost, however, I will give you hints to check several errors.

  • remove two brackets in if statements
  • remove `puts' which will automtically return
  • missing one more 'end' on the bottom
Derrick Williams
PLUS
Derrick Williams
Courses Plus Student 1,075 Points

Thank you. I'm not sure why 'end' was used twice, but it worked

Because you see definition on first line def which require end tag and now you put if statement that require another end tag. Yup, twice ends. :)