Python au lycée (2) : Les instructions conditionnelles Entraînement

Vrai/Faux : Booléens et comparaisons Python (niveau 1)

Durée estimée
5 minutes
Difficulté
Votre progression

Créez un compte gratuit pour suivre votre avancement et reprendre où vous avez laissé.

Créer un compte

Objectif 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.

  • (Correct) Vrai
  • (Incorrect) Faux