Skip to main content
formatting
Source Link
user3064538
user3064538

int(hexStringhexstring, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa", 16)
10

int(hexString, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa",16)
10

int(hexstring, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa", 16)
10
missing closing bracket
Source Link
El Developer
  • 3.3k
  • 1
  • 24
  • 41

int(hexString, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa",16)
10

int(hexString, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa",16
10

int(hexString, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa",16)
10
Added sample REPL
Source Link
unwind
  • 401.6k
  • 64
  • 491
  • 619

int(hexString, 16) does the trick, and works with and without the 0x prefix.:

>>> int("a", 16)
10
>>> int("0xa",16
10

int(hexString, 16) does the trick, and works with and without the 0x prefix.

int(hexString, 16) does the trick, and works with and without the 0x prefix:

>>> int("a", 16)
10
>>> int("0xa",16
10
Source Link
unwind
  • 401.6k
  • 64
  • 491
  • 619
Loading