Vrai/Faux : Booléens et comparaisons Python (niveau 1)
Créez un compte gratuit pour suivre votre avancement et reprendre où vous avez laissé.
Créer un compteObjectif travaillé
Pour chaque affirmation suivante sur le type booléen et les opérateurs de comparaison en Python, indiquez si elle est Vraie ou Fausse.
Déroulement pas à pas (Correction et Indices)
Question 1 : Affirmation : L'instruction type(True) renvoie class 'bool'.
- (Correct) Vrai
- (Incorrect) Faux
Question 2 : Affirmation : Pour tester si deux variables a et b sont égales, on écrit a = b.
- (Incorrect) Vrai
- (Correct) Faux
Question 3 : Affirmation : En Python, l'opérateur != signifie « différent de ».
- (Correct) Vrai
- (Incorrect) Faux
Question 4 : Affirmation : L'expression « abc » < « abd » renvoie False.
- (Incorrect) Vrai
- (Correct) Faux
Question 5 : Affirmation : L'instruction type(true) (avec un t minuscule) fonctionne correctement en Python.
- (Incorrect) Vrai
- (Correct) Faux
Question 6 : On exécute le programme Python suivant :
x = 5
print(x == 5)
Affirmation : Ce programme affiche True.
x = 5
print(x == 5)- (Correct) Vrai
- (Incorrect) Faux