If you want parity in the wire-communications sense (number of set bits modulo 2), that's n.count_ones() & 1 . Upvote 9
確定! 回上一頁