1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| print(" Taper la bonne réponse A,B,C ou si plusieurs réponses les réponses séparées d'un point ;(A;C par exemple)( ne pas oublier les majuscules , c'est une série de 10 questions . Si vous répondez autre chose que A B C le programme plantera il faudra le relancer . " )
Question = [["Quelle est le quantum d'un CAN 8 bits avec une pleine échelle 5 volts ?","A :1/51","B :8/5","C :40","B"],
["Quelle est l'accélération d'une voiture roulant à 100 km/h en t=1h en départ arrêté ? ","A :100km/h^2","B :6m/s^3","C :6m/s^2","C"],
["Comment commande t'on un moteur ?","A :Par Mli","B :Avec du courant","C :Par PWM avec du courant ","C"],
["Peut-on augmenter la vitesse d'un moteur ?","A :Impossible on a déja trop de couple","B :Avec un réducteur","C:Avec un multiplicateur","C :Lisbonne"],
["Comment peut-on être écolo demain? ","A :en jetant nos poubelles","B :En construisant de manière écolo","C :En enfouissant nos déchets","B"],
["Comment calcule-t-on l'intensité d'un courant à la sortie d'un composant dans un circuit?","A :Par loi des mailles","B :Par loi d'ohm","C :Par loi des noeuds","B;C"],
["Dans une batterie de 6 mAh et de tension 15v, Calculer l'energie disponible en joules","A :324 J","B :0.09 Wh","C : 90 J","B :C"],
[" Un bon moteur ","A :ça dépend?","B : un moteur avec un fort couple? ","C : un moteur qui tourne vite?","C :A;B;C;?"],
["Traduisez en décimal 01011111(b2)? ","A :95(B10)","B :55(B10)²","C :6(B10)","A"]]
qtal = Question #On enleve des éléments de la liste pour ne pas répéter la question.
x = 0
while x < 9 :
for i in range(0,1):
lQst = random.choice(qtal) #On prend une question
qtal.remove(lQst) #Qu'on enleve de notre liste de questions
print(lQst[0]) #On l'affiche
print(lQst[1]) #Les 3 réponses
print(lQst[2])
print(lQst[3])
LRep = str(input("Votre réponse: ")) #On redemande
LChx = LRep
if LChx == lQst[4]: #rpvrai
print("-- VRAI --\n")
print("Nouvelle question : " )
x += 1
else: #Sinon
print("-- FAUX --\n")
print(" La bonne réponse était : "), print(lQst[4])
print("Nouvelle question : " )
x += 1
x = 10
print(" Fin du jeu ! " ) |