Skip to content

Instantly share code, notes, and snippets.

@GravenilvecTV
Created November 24, 2018 19:18
Show Gist options
  • Select an option

  • Save GravenilvecTV/3c79c09262e83148550410cd8e4e2a24 to your computer and use it in GitHub Desktop.

Select an option

Save GravenilvecTV/3c79c09262e83148550410cd8e4e2a24 to your computer and use it in GitHub Desktop.
APPRENDRE LE PYTHON #3 ? LES CONDITIONS
# 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, "€")
@Steevedm
Copy link

Capture d'écran 2025-11-16 180606 Capture d'écran 2025-11-16 180651 Capture d'écran 2025-11-16 180709 Capture d'écran 2025-11-16 180808 Capture d'écran 2025-11-16 180849

@chez-drac
Copy link

Screenshot_2025-11-23-10-51-07-443_com kvassyu coding py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment