If branch question


#1

so i'm working along and i get an error with this code

print "Introduce yourself."

user_input = gets.chomp
user_input .downcase!

if user_input .include? "s" #Notice the space between user_input and .include?
  print "Found an s!"
end

codecademy tells me to make sure i call .include? on user_input, but i've done that. I read a couple QAs in here and see that no one else is using a space between user_input and .include? . I just don't understand why i can do it either way with .downcase! but not .include?


#2

Hi @loknir,

For this exercise, your code is 100% correct. This is Codecademy exercise bug. I will add this is in bugs spreadsheet :slightly_smiling:

P.S. While your code does work, it is not recommended (afaik) to leave a space between the method call like that. So, when you are working in big companies, which follow a rigorous style guide, I am 99% sure this method:

user_input .downcase!

will be discouraged.

Hope it helps! :smiley: