Найти - Пользователи
Полная версия: XOR и python
Начало » Python для новичков » XOR и python
1
vvl69
как в python сделать
XOR Checksum =2⊕3⊕……( n-1 ) ⊕n
s0rg
операция xor - ^
py.user.next
>>> import functools
>>> import operator
>>> 
>>> n = 5
>>> functools.reduce(operator.xor, range(2, n + 1))
0
>>> n = 6
>>> functools.reduce(operator.xor, range(2, n + 1))
6
>>>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB