Initial commit
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
if __name__ == '__main__':
|
||||
dice_roll = 5
|
||||
|
||||
if dice_roll > 4:
|
||||
print("Lancer réussi !")
|
@ -0,0 +1,5 @@
|
||||
if __name__ == '__main__':
|
||||
text = "Bonjour"
|
||||
# Ne devrait rien afficher puisque la chaîne ne correspond pas
|
||||
if text == "bonjouR":
|
||||
print("Bien le bonjour !")
|
@ -0,0 +1,7 @@
|
||||
if __name__ == '__main__':
|
||||
text = "Bonjour"
|
||||
# Ne devrait rien afficher puisque la chaîne ne correspond pas
|
||||
if text == "bonjouR":
|
||||
print("Bien le bonjour !")
|
||||
else:
|
||||
print("Je n'ai pas compris !")
|
@ -0,0 +1,12 @@
|
||||
# Valeur de départ à changer au besoin pour tester
|
||||
value = 8
|
||||
|
||||
# Tester plusieurs cas de figure s'excluant progressivement
|
||||
if value >= 9:
|
||||
print("Élevé")
|
||||
elif value >= 7:
|
||||
print("Haut")
|
||||
elif value >= 4:
|
||||
print("Standard")
|
||||
else:
|
||||
print("Bas")
|
@ -0,0 +1,7 @@
|
||||
a1 = 6
|
||||
a2 = 5
|
||||
|
||||
if a1 > 5 and a2 < 6:
|
||||
print("Conditions OK")
|
||||
else:
|
||||
print("Valeurs incorrectes")
|
@ -0,0 +1,7 @@
|
||||
a1 = 6
|
||||
a2 = 5
|
||||
|
||||
if a1 > 5 or a2 < 6:
|
||||
print("Conditions OK")
|
||||
else:
|
||||
print("Valeurs incorrectes")
|
@ -0,0 +1,13 @@
|
||||
is_on = True
|
||||
saisie = input("Saisissez une commande (Marche ou Arrêt) :")
|
||||
|
||||
if saisie == "Marche":
|
||||
if is_on is False:
|
||||
print("Allumage en cours…")
|
||||
else:
|
||||
print("Déjà allumé !")
|
||||
elif saisie == "Arrêt":
|
||||
if is_on:
|
||||
print("Extinction…")
|
||||
else:
|
||||
print("Déjà éteint !")
|
Reference in New Issue
Block a user