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 trial

Ruby Ruby Operators and Control Structures Ruby Control Structures Elsif challenge

How 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?

ruby.rb
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

Hi 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.

Thx so much. Very helpful.