Can you annotate and create a flowchart.
Can you also give description outlining which option chosen and a description of how it works and how to use it.
def decimalToBinary(dec):
if dec==0: return ''
else:
return decimalToBinary(dec//2) + str(dec%2)
def DecimaltoHex(n):
x = (n % 16)
characters = "0123456789ABCDEF"
rest = n // 16
if (rest == 0):
return characters[x]
return DecimaltoHex(rest) + characters[x]
n = eval(input('Enter a decimal integer: '))
print("Binary: ", decimalToBinary(n))
print("Hexadecimal: ", DecimaltoHex(n))
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here