Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
unhex 16 bit word python (string to hex)
#python 3.5.2 def unhex16(hexv): if len(hexv)<2: hexv="0"+hexv hexv=hexv.upper() dt=[0,0] c=0 for d in hexv: try: dt[c]=int(d) except: dt[c]=ord(d)-55 c += 1 rt=dt[0]*16+dt[1] return rt print(unhex16("b2")) print(unhex16("2b"))
run
|
edit
|
history
|
help
0
Current date/time
Calc1
Lesson 9 hw
EJ2_PYTHON_20.321.212-7
Python, finditer(), filter emails and place put in tuple
circle
Which Premier League match should I watch?
ok
PyStack
init constructor