Question: Why am I getting false for the following code?

```
def test(s)
   tester = s.split(//)
   for char in tester
       if char != 1 or char != 0
          return false
       end  
   end
   return true
end 

puts test("11111000")
# => false

```

Thank you in advance for your answer!

Answer: 
`char` is a string, so it will never equal either `1` or `0` - only `"1"` or `"0"`

This code will work:

```
def test(s)
   tester = s.split(//)
   for char in tester
       if char != '1' and char != '0'
          return false
       end  
   end
   return true
end 

puts test("11111000")
# => true
puts test("111110002")
# => false

```

a more succinct way to do the same will be

```
def test(s)
  s =~ /^[10]*$/
end

```
I'm not really sure what this code is supposed to do, but you have used some constructions, that (even though they are available) would not be considered ruby-way:

* you have used `or` instead of `||` -- `or` is usually used for flow control notation, and has very low precedence
* you have used `for ... in ...` instead of iterator
* you are explicitly trying to return `true`/`false` while it can be done in cleaner way by using correct iterator.

Solution easier to read and understand would probably look more like that:

```
def test(s)
   s.split(//).any? { |char| char != 1 || char != 0 }
end 

```

Please note that there are more problems with your code (comparing strings with numbers and using condition that is always true) pointed by others.