How to use python to batch hexadecimal

StackOverFlow I have a question. Enter two numbers, one is a 'D1', and the other is a 'D2' they are all hexadecimal, 'D2' such as: [6e], then use the 'D2' to subtract each number in hexadecimal such as: [1,2,3,4,5,6,7 to F6,F7,F8,F9,FA,FB,FC,FD,FE,FF), assign the subtracted value to a new variable, then use the new variable to XOR the 'D1','D1' such as [d0], and output the result of the XOR. I simply wrote a bunch of codes

r = input("D2: ")
k = input("Hex: ")
o = int(r, 16)
l = int(k, 16)
d = o - l
s = input("D1: ")
e = int(s,16)
y = d ^ e
print(hex(y))

Program running

The general flow of calculation

Check this

Can tell me how to perform batch operations with hexadecimal..



from Recent Questions - Stack Overflow https://ift.tt/2TXzOZd
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Today Walkin 14th-Sept

Object oriented programming concepts (OOPs)