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: 
It is because `char != 1 or char != 0` is always `true`. Whatever `char` is, it cannot be both `1` and `0` at the same time.

---

The following is only based on a guess regarding the purpose of the OP's code. If the purpose was to check if `s` includes nothing but `"1"` or `"0"`, then, I would do:

```
s !~ /[^01]/

```
If you are trying to check that a string is made up of ONLY 1s and 0s, you can just do:

```
def test(s)
 s.scan(/[^0-1]/).length == 0
end 

puts test("11111000") # => true
puts test("1234") # => false
puts test("234") # => false

```