Decimal to Hexadecimal Conversion

    0

    0

    CrypticSai-08

    def convert(num):
        hexa = []
        while num != 0:
            rem = num % 16
            if rem < 10:
                hexa.append(chr(rem + 48))
            else:
                hexa.append(chr(rem + 55))
            num = num // 16
        hexa.reverse()
        return ''.join(hexa)
    decimal = 2545
    print("Hexadecimal :", convert(decimal))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.