Created
November 24, 2018 19:18
-
-
Save GravenilvecTV/3c79c09262e83148550410cd8e4e2a24 to your computer and use it in GitHub Desktop.
APPRENDRE LE PYTHON #3 ? LES CONDITIONS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Place de cinema | |
| # recolter l'age de la personne "Quel est votre age ?" | |
| age = int(input("Quel est votre age ?")) | |
| # si la personne est mineur -> 7€ | |
| if age < 18: | |
| prix_total = 7 | |
| # si la personne est majeur -> 12€ | |
| else: | |
| prix_total = 12 | |
| # ou alors en ternaire | |
| # prix_total = (7, 12)[age < 18] | |
| # souhaitez-vous du pop corn ? | |
| pop_corn_request = input("Souhaitez-vous du pop corn ? (Oui, Non)") | |
| # si oui | |
| if pop_corn_request == "Oui": | |
| prix_total += 5 | |
| print("Vous devez payer", prix_total, "€") |
chez-drac
commented
Nov 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment