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 trialMarguerite Holden
6,075 PointsHow do I use the elsif statement here? What's missing?
I'm really at a loss here. can you help me? Please can you help me?
car_speed = 55
speed_limit = 55
if car_speed < speed_limit
too_fast = false
else
too_fast = true
elsif
going_speed_limit = true
end
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Marguerite,
else
statements need to always come last. The elsif has to be between the if
and the else
. It also needs to have a condition on it like the if
does.
In this case, the condition is car_speed == speed_limit
Let me know if you're still stuck.
Marguerite Holden
6,075 PointsThx so much. Very helpful.