문제

If I have a char d and a char k, how do I turn each into a bit array (such as True-False-True-True-True-False-False-True) and then combine the arrays into a single array by AND-ing each bit (and then turning the combined array back into a char)? Such as 01100001 (a) and 01100011 (c) combine to make 01100001 (c)? Also, sometimes the results of these conversions are not ASCII (such as 00000010)?

도움이 되었습니까?

해결책

no need to make an array:

>>> chr(ord('c') & ord('a'))
'a'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top