-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
  • 55,782
  • 14
  • 81
  • 108
user23634623
  • 151
  • 5
  • 11

1 Answers1

0

maybe you are looking for something like:

x.encode("hex")
Stefano Saitta
  • 1,844
  • 1
  • 19
  • 34