[Python] Why Does Hex() Function returns a string instead an int hex?

Discussão em 'Python' iniciado por Stack, Abril 5, 2025.

  1. Stack

    Stack Membro Participativo

    I dont know why Hex function returns a string like '0x41' instead 0x41

    [​IMG]

    I need to convert an ASCII value into a hex. But i want in 0x INT format, not into a '0x' string.

    ascii = 360
    hexstring = hex(ascii)
    hexstring += 0x41 # i cant do this because hexstring is a string not a int hex


    How i can get a int hex?? thanks

    Continue reading...

Compartilhe esta Página