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.

Derrick Williams
Courses Plus Student 1,075 Pointslogical operators challenge
I'm not sure where i'm going wrong here
def check_speed(car_speed)
# write your code here
if (car_speed > 39) && (car_speed <= 50)
puts "safe"
end
3 Answers

Salman Akram
Courses Plus Student 40,065 PointsHi 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
Courses Plus Student 1,075 PointsThank you. I'm not sure why 'end' was used twice, but it worked

Salman Akram
Courses Plus Student 40,065 PointsBecause 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. :)

Derrick Williams
Courses Plus Student 1,075 PointsGotcha.. Thank you