I have a function that I use to compare two strings character by character and do some additional tasks on it. I want to modify it to compare hex numbers instead.
For example: If A = "hello"
, B = "himan"
were to be compared. I used to run a for
loop and compare character by character. It worked fine.
for x, y in zip(A, B):
if x == y:
do something
How do I modify it to consider hex numbers. For example, if A = "30303867"
and B = "3f160303"
, I want to match 30
with 3f
first then so on. Normally, I can only match 3
by 3
and so on.
Thanks