Skip to content

Instantly share code, notes, and snippets.

@X-88
Created May 15, 2020 19:15
Show Gist options
  • Save X-88/cffeeb10f7ff6b11c2e1340caba8d40c to your computer and use it in GitHub Desktop.
Save X-88/cffeeb10f7ff6b11c2e1340caba8d40c to your computer and use it in GitHub Desktop.
String to Decimal & Hexa Decimal
from os import system
system("clear")
StrList = "0123456789ABCDEF"
msg = "Apps: String To Hex\nCoded by: Zephio\nLang: Python 3.xx"
spr = "==========================="
print(spr)
print(msg)
print(spr)
inp = input("Enter Text Here: ")
print(spr)
for x in inp:
y = ord(x)
z = str(y // 16) + StrList[y % 16]
print("Result: " + x, " ", y, " ", z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment