Unless not able to take decision


#1



https://www.codecademy.com/courses/ruby-beginner-en-NFCZ7/3/3?curriculum_id=5059f8619189a5000201fbcb#


Unless is not making right decision. Assuming condition true in all the cases.
doesn't matter what the output is always "yes it is you"


Replace this line with your code. 

print "enter your name" + "\n"
name = gets.chomp
puts name
unless name == "Abhas" || name == "abhas"
    puts "yes its you"
end


#2

Seems perfectly capable of telling the difference between a person named abhas and everyone else, look:

$ ruby abhas.rb 
enter your name
abhas
abhas

$ ruby abhas.rb 
enter your name
bob
bob
yes its you

Keep in mind what the English word "unless" means.


#3

Oh yes.
My Bad. Thanks for help :slight_smile:


#4

Oh Yes.
Thanks for help :slight_smile:


#6

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