Setting Up the 'If' Branch, Part 1


#1

print "what is the user_input?" 
user_input = gets.chomp 
user_input = user_input.downcase! 
 if user_input.include? "S" 
     print "yes" 
     elsif user_input.include? "s"
     print "yes" 
 else 
     print "no" 
 end

can somebody please help me? :frowning:


#2

Hi @denish96,
Please give exercise link. And what error do you get? Thanks! :slightly_smiling:

P.S. Always format your code as stated here :slightly_smiling:


#3

hey thank you so much but after spending a night in it,i finally figured it out! but thank you so much for wanting to help, i was skeptical that nobody was going to.


#4

Hi @denish96, it is great news that you were able to solve it yourself! :slightly_smiling: Could you please post here what problem was in the original code so that if other users come here they would be able to understand the problem.

Thanks! :slightly_smiling:


#5

Ofc no problem, i'm finishing a code as soon as i'm done i'll do so :slightly_smiling:


#6

THIS IS THE RIGHT CODE :

print "what is the user_input?"
user_input = gets.chomp
user_input = user_input.downcase

if user_input.include? "s"
print user_input "yes"
end