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 trialSeth Schwartz
3,108 PointsCode not working
Using an "elsif" statement, modify the code below to check whether or not the car_speed is equal to the speed_limit. If it is, set the variable "going_speed_limit" to true. My code is as follows:
car_speed = 55 speed_limit = 55
if car_speed < speed_limit too_fast = false elsif car_speed == speed limit going_speed_limit = true else too_fast = true end
car_speed = 55
speed_limit = 55
if car_speed < speed_limit
too_fast = false
elsif car_speed == speed limit
going_speed_limit = true
else
too_fast = true
end
1 Answer
Ari Misha
19,323 PointsHiya Seth! You're almost there , just replace "speed limit" with "speed_limit" in your "elsif" block. If it still doesnt pass , here is the code for your reference:
car_speed = 55
speed_limit = 55
if car_speed < speed_limit
too_fast = false
elsif car_speed == speed_limit
going_speed_limit = true
else
too_fast = true
end