CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

aide python

hakan43120
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
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
Azerban
Niveau 16
09 mars 2021 à 20:53:44
import math

def logbase(v, b):
    return math.log10(v) / math.log10(b)
hakan43120
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
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 :hap:

hakan43120
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

Bah oui ce n'est pas la même chose :hap:

ok c bn nickel sa fonctionne merci

Sous forums
  • Aide à l'achat Mac
  • Création de Jeux
  • Linux
  • Programmation
  • Création de sites web
  • Internet
  • Steam Deck
  • Macintosh
  • Hardware
La vidéo du moment