4. Setting Up the 'If' Branch, Part 1!

print user_imput = gets.chomp.downcase!
if user_imput.include? “s”
print “there is a s”
end

does this code work for you guys? it does not work for me

I have exactly the same problem. Did you find a solution?

Here, this worked for me

print “Please type here your statement”
user_input = gets.chomp
user_input.downcase!
if
user_input.include? “s”
else
puts “\(^O^)/”
end

-MZ

1 Like

print user_imput = gets.chomp.downcase!

Your code was almost right except for the typo and “input” and the method chaining. If you put user_input.downcase! on its own line you should pass. (I made the same mistake)

1 Like

I’m so confused about this :tired_face:

do you take out the .include or do you not???

when I tried to used what MZ used I got a error message

It should work if you remove the !, i.e. user_input=gets.chomp.downcase.

If I understand correctly (which I very well may not), since ! prevents the creation of a new copy of what is returned by gets.chomp, user_input will end up being nil. By removing the !, you let .downcase return a lowercase copy of what what returned by gets.chop, which is then set to user_input.

1 Like

Hey thanks man…it helped me pass to the next stage!

That was it for me, too. Thanks!

Nice ,Thanks,it helped me pass to the next stage!

Thanks for this guys !