Basto Biih5,334 Points
If Conditional Statement
Don't really know what else to do here, it ran with errors put I guess I'm close.
def check_speed(speed) if speed < 45 print "too slow" end if speed =45 && speed >= 60 print "speed OK" end if speed > 60 print "too fast" end check_speed(speed) end
Jason AndersTreehouse Moderator 144,350 Points
You are on the right track and very close
First, you'll need to put the
puts... challenges are very picky and don't like when you change the preloaded code that you weren't asked to change.
Next, there is just a logic error with the second
if statement. The way you have it, the speed has to be exactly 45 and greater than or equal to 60 for it to return true, which is impossible. So, you'll need to adjust the first part to include anything greater than or equal to 45, and then change the second part to be less than or equal to 60.
Lastly, the instruction do not ask you to call the function. Doing this will cause the Code Checker to error out with a "Communication Error". Again, if the instructions don't say to do it... don't. So, just delete this line completely.
Once those are fixed up, the code will pass. Other than that, Great Job! :)