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 trialDerrick 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