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 trialTanzila Rafeeq
2,936 Pointsi keep getting a syntax error and i keep trying different things and they dont fix it they say its in line one.
no details
def check_speed(80)
if check_speed < 55
puts "too fast"
end
if check_speed > 55
puts "too slow"
end
if check_speed == 55
puts "speed OK"
end
2 Answers
jb30
44,806 PointsThe challenge doesn't want you to specify the number to pass in to the method. It wants you to use a variable to represent a number, such as by using def check_speed(speed)
, then checking if the value for the variable is less than, more than, or equal to 55.
You should also close your last if statement with end
so that the if statement ends and the check_speed class ends.
Tanzila Rafeeq
2,936 Pointsbut i am using the end method to close it.