update
This commit is contained in:
@@ -1,23 +1,105 @@
|
||||
#recolter l'age des clients
|
||||
age = int(input("Quel est votre age ?"))
|
||||
price_mineur = 7
|
||||
price_majeur = 12
|
||||
i = 18
|
||||
d = "€" #devise est egale à devise
|
||||
if age >= i :
|
||||
print("vous etes majeur ! veuillez payez 12€ !")
|
||||
elif age <= i :
|
||||
print("vous etes mineur ! veuillez payez 7€ !")
|
||||
#proposition popcorn
|
||||
pop_price = 5
|
||||
proposition = input("voulez vous du pop corn ? :")
|
||||
if proposition == "oui" and age > i :
|
||||
print("parfait , la facture s'élève à:" , price_majeur+pop_price,"€")
|
||||
elif age > i and proposition == "non" :
|
||||
print("votre facture est de :", price_majeur,d)
|
||||
elif age < i and proposition == "non" :
|
||||
print("votre facture est de :" , price_mineur,d)
|
||||
elif age < i and proposition == "oui" :
|
||||
print("votre facture est de :",price_mineur+pop_price,"€")
|
||||
#création des variables de bases
|
||||
age = 18
|
||||
p_majeur = 12
|
||||
p_mineur = 7
|
||||
devise = "€"
|
||||
minimal = 10
|
||||
p_pop = 5
|
||||
total_pop1 = p_mineur+p_pop
|
||||
total_pop2 = p_majeur+p_pop
|
||||
#recolte de l'age et comparaison
|
||||
option = int(input("Saisissez votre age :"))
|
||||
#conditon de price
|
||||
if minimal < option < age :
|
||||
print("Vous etes mineur , ça fera :",p_mineur,devise)
|
||||
elif minimal < option >= age :
|
||||
print("Vous etes majeur :",p_majeur,devise)
|
||||
elif option == minimal :
|
||||
print("Vous etes mineur , ça fera :",p_mineur,devise)
|
||||
#condition d'age requis
|
||||
while option < minimal :
|
||||
print("tu es trop jeune !")
|
||||
option = int(input("Réecrivez votre age :"))
|
||||
#souhaitez vous du pop corn ? si oui +5€
|
||||
pop = str(input("Voulez vous aussi du pop corn ? :"))
|
||||
R1 = "oui"
|
||||
R2 ="non"
|
||||
#regles du pop corn pour oui et non mineur
|
||||
if pop == R1 and minimal < option < age :
|
||||
print("Vous payez :",total_pop1,devise)
|
||||
elif pop == R2 and minimal < option < age :
|
||||
print("Vous payez :",p_mineur,devise)
|
||||
#regles du pop corn pour oui et non majeur
|
||||
elif pop == R1 and option >= age :
|
||||
print("Vous payez :",total_pop2,devise)
|
||||
elif pop == R2 and option >= age :
|
||||
print("Vous payez :",p_majeur,devise)
|
||||
#regles du pop corn pour les 10 ans
|
||||
elif pop == R1 and age > option >= minimal :
|
||||
print("Vous payez :",total_pop1,devise)
|
||||
elif pop == R2 and age > option >= minimal :
|
||||
print("Vous payez :",p_mineur,devise)
|
||||
while pop != R1 and pop != R2 :
|
||||
print("Choix Non Valide ❌")
|
||||
pop = str(input("Voulez vous du pop corn ? :"))
|
||||
if pop == R1 and minimal < option < age :
|
||||
print("Vous payez :",total_pop1,devise)
|
||||
elif pop == R2 and minimal < option < age :
|
||||
print("Vous payez :",p_mineur,devise)
|
||||
#regles du pop corn pour oui et non majeur
|
||||
elif pop == R1 and option >= age :
|
||||
print("Vous payez :",total_pop2,devise)
|
||||
elif pop == R2 and option >= age :
|
||||
print("Vous payez :",p_majeur,devise)
|
||||
#regles du pop corn pour les 10 ans
|
||||
elif pop == R1 and age > option >= minimal :
|
||||
print("Vous payez :",total_pop1,devise)
|
||||
elif pop == R2 and age > option >= minimal :
|
||||
print("Vous payez :",p_mineur,devise)
|
||||
#proposition des fils et prix
|
||||
film1 = "anabelle"
|
||||
film2 = "avatar"
|
||||
film3 = "avengers"
|
||||
film4 = "naruto"
|
||||
avatar = 10
|
||||
anabelle = 10
|
||||
avengers =15
|
||||
naruto = 20
|
||||
# Choix des films
|
||||
print("Les films disponibles sont : anabelle, avatar, Naruto et avengers")
|
||||
choix_film = input("Lequel désirez-vous visionner ? : ")
|
||||
|
||||
# refus film anabelle pour mineur
|
||||
while choix_film == film1 and option < age:
|
||||
print("Vous êtes trop jeune pour ce film, veuillez en choisir un autre !")
|
||||
choix_film = input("Choisissez un autre film : ")
|
||||
|
||||
# vérifier si film valide
|
||||
if choix_film not in [film1, film2, film3, film4]:
|
||||
print("Choix non valide ❌")
|
||||
exit()
|
||||
# CALCUL PRIX FILM
|
||||
if choix_film == film1:
|
||||
prix_film = anabelle
|
||||
elif choix_film == film2:
|
||||
prix_film = avatar
|
||||
elif choix_film == film3:
|
||||
prix_film = avengers
|
||||
elif choix_film == film4:
|
||||
prix_film = naruto
|
||||
# CALCUL PRIX BASE (âge)
|
||||
if option >= age:
|
||||
prix_base = p_majeur
|
||||
else:
|
||||
print("choix invalide")
|
||||
prix_base = p_mineur
|
||||
# CALCUL FINAL POPCORN
|
||||
if pop == R1:
|
||||
facture = prix_base + prix_film + p_pop
|
||||
elif pop == R2:
|
||||
facture = prix_base + prix_film
|
||||
else:
|
||||
print("Choix non valide ❌")
|
||||
exit()
|
||||
|
||||
print("Votre facture est :", facture, devise)
|
||||
print("Merci à Vous Bon Visionnage !!🍿")
|
||||
Reference in New Issue
Block a user