Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ip = input("Enter the IP Address : ")
- L1 = ip.split(".")
- str1 = ""
- for i in range(len(L1)):
- int_i = int(L1[i])
- hex_val = str(hex(int_i))
- str1 += hex_val[2:].upper()
- if i != len(L1) - 1:
- str1 += "."
- print("The IP Address in Hexadecimal : ", str1)
Advertisement
Add Comment
Please, Sign In to add comment