I dont know whats wrong with my code!


Im a beginner and i cant figure out where i went wrong in the code...i simply cant get an output!

Every time i execute i recieve an error msg saying the if block has an error.

print ( "enter your string:" )
if user_input.include? " s "
    puts "no S"


HI remove the end before the else statement


Remove the end in the middle of the if statement.

You have to have an Upper Case letter in your string so that .downcase! has something to return, otherwise it stuffs up the .include method.

Hope this helps. :wink:


I think the problem is that you are referring to your variable 'user_input' as 'user-input' (with a dash instead of an underscore) in several places.


good spotting! If they use both our help, they will get it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.