May-08-2020, 12:23 PM
Hello, I have several Python exercises to do in homework. I find some of them impossible to do, I hope you can help me:
"You must write a function calcule_prix(de1, de2) (de= a dice) which takes as parameter two integers between 1 and 6, the value of two dice.
If the sum is greater than or equal to 10, then you have to pay a special tax (36 pieces).
Otherwise, you pay twice the sum of the values of the two integers.
Your function should display the text "Special tax!" "Or" Regular tax ", then the amount to be paid (without indicating the unit)."
This is what i have came up with:
Taxe sepciale= special tax
Taxe reguliere= regular tax
Thank you in advance!
"You must write a function calcule_prix(de1, de2) (de= a dice) which takes as parameter two integers between 1 and 6, the value of two dice.
If the sum is greater than or equal to 10, then you have to pay a special tax (36 pieces).
Otherwise, you pay twice the sum of the values of the two integers.
Your function should display the text "Special tax!" "Or" Regular tax ", then the amount to be paid (without indicating the unit)."
This is what i have came up with:
def calcule_prix(de1, de2): 1 <= de1 <= 6 1 <= de2 <= 6 if de1+de2 =>10: print("Taxe spéciale !","36 pièces") else: print("Taxe régulière","(de1+de2)*2")
Taxe sepciale= special tax
Taxe reguliere= regular tax
Thank you in advance!
