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 trialBen Santen
1,998 PointsI can't my coding error
It keeps returning syntax errors
def check_speed(car_speed)
if (car_speed >= 40) && (car_speed is <= 50)
puts "safe"
else
puts "unsafe"
end
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHey Ben,
In addition to Ari's point of the missing end
, there are also two other errors that will prevent you from passing.
- The instructions explicitly ask to
return
the strings, but you are usingputs
. - In the
if
conditional, the second part, you have the word "is" in there for some reason. It should read like the first part (no "is").
Fix up what Ari pointed out, and correct these two, and the challenge will pass.
Keep Coding! :)
Ari Misha
19,323 PointsHiya Ben! You forgot to close your "if" statement with "end" keyword. Do that and you're good to go. (: