From: Sam Rose Date: 2011-11-09T23:06:34+09:00 Subject: Re: Can't get "or" or "||" to work. Hi James, You're very close. This code should work: name = gets.chop.downcase if name != "bob" || name != "fred" puts "That wasn\'t one of the choices." else code You have to have a full expression for each part of the conditional. What was happening previously was this: The if statement checked the expression: name != bob Then the is statement checked the expression: "fred" In Ruby, anything that is not nil or false is considered true. Thus "fred" is considered true. I hope this has explained your problem :) Thanks, Sam On 9 November 2011 14:02, james gallagher wrote: > Hi.  I have a stupid question. > > I'm stuck on the bit of ruby that follows: > > name = gets.chop.downcase > if name != "bob" || "fred" >  puts "That wasn\'t one of the choices." > else >  code > > If I put "bob" in it says: > > That wasn't one of the choices. > > It does the same for anything I put in. > > Thank you. > > -- > Posted via http://www.ruby-forum.com/. > >