-
-
Save GravenilvecTV/3c79c09262e83148550410cd8e4e2a24 to your computer and use it in GitHub Desktop.
# 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, "€") |
un nouveau commentaire parmi tant d'autre.... :
prix = 0
age = int(input("Quel est votre âge ? : "))
if age >= 18:
prix = prix + 12
else:
if age <= 17:
prix = prix + 7
popcorn = input("Souhaitez-vous du pop-corn ? (5€). [Y/N] : ")
if popcorn == "Y":
prix = prix + 5
else:
if popcorn == "N":
prix = prix
print("Le prix total est de " + str(prix) + "€")
age = int(input("Quel est votre age"))
total = 0
if age < 18 :
print("Place enfant : 7 €")
total = 7
else:
print("Place adult : 8€")
total = 8
pop_corn = (input("Souhaitez vous des pop corn?"))
if pop_corn == "oui":
total = total + 5
print("Pôt de pop corn : 5€")
else:
total = total
print("Cela vous coûte " + str(total) + "€ au total.")
#code
Minor_price = 7
Major_price = 12
Popcorn_price = 5
#Récolter l'age
age = int(input("Quel est votre age ?"))
if age<18 :
print("vous devez payer "+str(Minor_price)+"euro")
Total_price = Minor_price
else:
print("vous devez payer "+str(Major_price)+"euro")
Total_price = Major_price
sugest = input("voulez vous du popcorn? (oui,non)")
if sugest == "oui" :
print("vous devez payer "+str(Popcorn_price)+"euro de plus")
Total_price = Total_price + Popcorn_price
print("ça vous fait donc "+str(Total_price)+"euro")
else:
print("ça vous fait donc "+str(Total_price)+"euro")
age = int(input("Quel est votre age ?"))
if age < 18:
print("Le tarif est de 7€")
price = 7
else:
print("Le tarif est de 12€")
price = 12
popcorn_request = input("voulez vous du popcorn pour 5€ ? oui, non")
popcorn = 5
if popcorn_request == "oui":
prix_total = price + popcorn
print("le tarif total sera de {}€".format(prix_total))
else:
print("le tarif total sera de {}€".format(price))
age = int(input("Quel est votre age ?"))
if age < 18
price = 7
popcorn = int(input("voulez vous du popcorn ?"))
if popcorn = oui
price = price + 5
print("Le prix est de : " + price + " euro")
else
print("le prix est de 7 euro")
else
price = 12
popcorn = int(input("voulez vous du popcorn ?"))
if popcorn = oui
price = price + 5
print("le prix est de :" + price + "euro")
else
print("le prix est de " + price "euro")
si quelqu'un trouve les erreurs, bien joué parce que la c'est chaud. Je pense que l'erreure vien du fait que j'ai enboité plusieurs condition les unes dans les autres !
cinema_price = 0
age = int(input("Quel est votre âge ? "))
if age <= 17:
cinema_price = cinema_price + 7
else:
cinema_price = cinema_price + 12
pop_corn = input("Souhaitez-vous du pop-corn (oui ou non) ? ").lower()
if pop_corn == "oui":
cinema_price = cinema_price + 5
else:
cinema_price = cinema_price
print(cinema_price)