Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12231

What's wrong with this simple boolean expression in Ruby?

$
0
0

Here is my Ruby 3.2 code:

puts (1 and 0)puts (1 and 0 and 1)

It prints 0 and then 1 (I'm expecting 0 in both cases). Can someone explain, why?


Viewing all articles
Browse latest Browse all 12231

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>