 Créez un programme qui convertit un nombre de base 10 en base 16.
 254
def number_converter(number): \n #Hexadecimal Number System \n hexadecimal = ["0", "1", "2", "3", "4", "5", "6", "7", " 8", "9", "A", "B", "C", "D", "E", "F"]\n \n # convertir en binaire \n binaire = bin(nombre).replace( "0b","")\n \n # index\ni = 0\n hexa = ""\n # Boucle While de 0 au nombre de bits\n while(i < len(binary)):\n bit_four = binaire[i : i + 4]\n reste = bit_four % 16 #16 est la base 16 \n hexa += hexadécimal[reste]\ni += 4\n return hexa \n\nres = number_converter(254)\nprint (res)\n# sortie : FE