Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #hex2dec
- hex = input("Input Hex Value: ")
- hex2dec = int(hex, 16)
- print(hex2dec)
- #dec2bin
- dec = int(input("Input Binary Value: "))
- #decToBin(dec)
- decToBin = bin(dec)[2:]
- print(decToBin)
- #hexproduct
- hexPro1 = input("Hex1: ")
- hexPro2 = input("Hex2: ")
- hex2dec1 = int(hexPro1, 16)
- hex2dec2 = int(hexPro2, 16)
- decProduct = hex2dec1*hex2dec2
- decHexProduct = "%X" % decProduct
- print(decHexProduct)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement