-2

I want to convert string to a hex (decimal), for example abc to 616263 and so on. How do I do that?

I have tried:

x= input("Enter string")
x = int(x)
hex(x)

But it is not working.

khelwood
  • 52,115
  • 13
  • 74
  • 94
user23634623
  • 131
  • 4
  • 11

1 Answers1

0

maybe you are looking for something like:

x.encode("hex")
Stefano Saitta
  • 1,584
  • 18
  • 32