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!
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
Add an else clause to the if statement which calls the display_car_speed method
The task is as previous. Here is what I did if ..... else display_car_speed() end
However, it said my answer was incorrect :(. I don't know why. Can anyone explain to me ?
Brandon Hartman8,032 Points
Hopefully this helps you out!!
car_speed = 50
speed_limit = 45
if (car_speed > speed_limit)
Vladislav Trotsenko9,291 Points
What the bullshit? Why my solution has not acceptable? Why in some tasks isn't possible to use ternary operator???
car_speed, speed_limit = 50, 45 car_speed > speed_limit ? flash_car_speed : display_car_speed
But if I using ugly code like this, everything is OK???
car_speed, speed_limit = 50, 45 if car_speed > speed_limit flash_car_speed else display_car_speed end