Search code examples
pythoninthex

How to get rid off of the 0x?


I have the next string 0x00x41 is an hexadecimal code but I want to get rid off of the 0x. Can you tell someone how to do that?


Solution

  • I think you could do it with this:

    x = 0x00x41
    y = x.replace("0x", "")
    print (y)
    

    The output should be:

    041