Skip to content
Discussion options

You must be logged in to vote

There's a few ways but these are the first ways I thought of to convert both directions

>>> i = 0x32
>>> i
50
>>> hex(i)
'0x32'
>>> int('0x32', 0)
50

Replies: 3 comments 4 replies

Comment options

andrewleech
Oct 27, 2023
Collaborator Sponsor

You must be logged in to vote
2 replies
@jimmo
Comment options

@andrewleech
Comment options

andrewleech Oct 27, 2023
Collaborator Sponsor

Answer selected by jimmo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@andrewleech
Comment options

andrewleech Oct 27, 2023
Collaborator Sponsor

@robert-hh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants