list = []
for n in range(256):
s = bin(n)[2:]
s = str(s)
if len(s) < 8:
s = '0' * (8 - len(s)) + s
R = int(s[::-1])
s = int(s)
result = int(str(s - R), 2)
list.append(result)
print(max(list))
10000000 - 00000001 = 01111111 = 127
11000000 - 00000011 = 10111101 = 189
11100000 - 00000111 = 11011001 = 217
11110000 - 00001111 = 11100001 = 225
11111000 - 00011111 = 11011001 = 217
Но если хочешь кодом, то: print(max([n - int((bin(n)[:1:-1] + '0000000')[:8], 2) for n in range(256)]))