Bonjour à tous ,
voici mon code :
et voici le message à l'execution :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 from math import pow def binToDecimal(binaire): resultat = 0L for bit in binaire: if bit == '1': resultat = resultat + math.pow(2**(int(bit)) return resultat nombre = raw_input('Entrez le nombre binaire : ') decimal = binToDecimal(str(nombre)) print decimal
"There's a error in your program
Invalid syntax"
Le mot "return" est surligné en rouge ????
Partager