Setting Up the 'If' Branch, Part 1


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-JdNDe/0/4?curriculum_id=5059f8619189a5000201fbcb


The code I have works, but the "test" is saying that it's wrong, unless I put a caps in somewhere.

Seriously? I figured Ruby would be smart enough to recognize if it's caps or not.


print "Enter in a statement."
user_input = gets.chomp.downcase!
if user_input.include? "s"
end
print user_input


#2

Seriously. Ruby returns the altered string IF any change takes place, else it returns nil. Of course, nil has no attributes so no include method. Use downcase so the inputs don't matter.


#3

When it asks to use downcase to pass by, it seems sort of counter intuitive...


#4

Until we read up on it and discover the difference between downcase and downcase!.


#5

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