En ce momentGenshin ImpactValhallaBreath of the wildAnimal CrossingGTA 5Red dead 2
Liste des sujets
aide python
hakan43120
Niveau 11
09 mars 2021 à 20:38:39
bonjour je suis bloquée a un exo je sais pas comment m'y prendre je dois écrire la fonction de logbase et la vérifier avec les données logbase(1024, 2) qui donne 10 en résultat et logbase(1024, 1024) qui donne 1
https://imgur.com/VLpRTfF
hakan43120
Niveau 11
09 mars 2021 à 20:41:28
j'ai commencer avec sa mais sa marche pas du tout def logbase(x,y): return log( x,y ) / log( 2 )
Azerban
Niveau 16
09 mars 2021 à 20:53:44
import math
def logbase(v, b):
return math.log10(v) / math.log10(b)
hakan43120
Niveau 11
09 mars 2021 à 21:15:06
Le 09 mars 2021 à 20:53:44 Azerban a écrit : import math
def logbase(v, b):
return math.log10(v) / math.log10(b)
j'ai pourtant fait from math import *
mais j'ai l'erreur NameError: name 'math' is not defined
Azerban
Niveau 16
09 mars 2021 à 21:53:37
Le 09 mars 2021 à 21:15:06 hakan43120 a écrit :
Le 09 mars 2021 à 20:53:44 Azerban a écrit : import math
def logbase(v, b):
return math.log10(v) / math.log10(b)
j'ai pourtant fait from math import *
mais j'ai l'erreur NameError: name 'math' is not defined
Bah oui ce n'est pas la même chose
hakan43120
Niveau 11
10 mars 2021 à 00:54:01
Le 09 mars 2021 à 21:53:37 Azerban a écrit :
Le 09 mars 2021 à 21:15:06 hakan43120 a écrit :
Le 09 mars 2021 à 20:53:44 Azerban a écrit : import math
def logbase(v, b):
return math.log10(v) / math.log10(b)
j'ai pourtant fait from math import *
mais j'ai l'erreur NameError: name 'math' is not defined