I want to make a range in python from variable a and variable b
a = 0x88
b = 0xff
for x range(a, b):
print(x)
from my code the result like this
136, 137, 138, 139 ...
but I want the result of looping like this
88, 89, 8a, 8b, 8c, 8d, 8e, 8f, 90, 91 .... ff
please help me, thank you
Use hex()
function:
a = 0x88
b = 0xff
for x in range(a, b):
print(hex(x))
results in:
0x88
0x89
0x8a
0x8b
0x8c
0x8d
0x8e
0x8f
0x90
0x91
0x92
0x93
0x94
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With