Knowee
Questions
Features
Study Tools

n_livres = int(input("Entrez le nombre de livres empruntés : "))if n_livres == 2:        montant= 5elif n_livres > 2:        livres_supplementaires = n_livres - 2        montant = 5+ (2 * livres_supplementaires)else:       print("Entrée non valide. Veuillez saisir un nombre correcte !")       montant= 0if montant != 0:       print("Montant :", montant, "Dt")a.Montant : 11 Dtb.Montant : 30 Dtc.Entrée non valide. Veuillez saisir un nombre correcte !d.Montant : 13 Dte.Entrée non valide. Veuillez saisir un nombre correcte !Montant : 0 Dt

Question

n_livres = int(input("Entrez le nombre de livres empruntés : "))if n_livres == 2:        montant= 5elif n_livres > 2:        livres_supplementaires = n_livres - 2        montant = 5+ (2 * livres_supplementaires)else:       print("Entrée non valide. Veuillez saisir un nombre correcte !")       montant= 0if montant != 0:       print("Montant :", montant, "Dt")a.Montant : 11 Dtb.Montant : 30 Dtc.Entrée non valide. Veuillez saisir un nombre correcte !d.Montant : 13 Dte.Entrée non valide. Veuillez saisir un nombre correcte !Montant : 0 Dt

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

n_livres = int(input("Entrez le nombre de livres empruntés : "))

if n_livres == 2: montant = 5 elif n_livres > 2: livres_supplementaires = n_livres - 2 montant = 5 + (2 * livres_supplementaires) else: print("Entrée non valide. Veuillez saisir un nombre correcte !") montant = 0

if montant != 0: print("Montant :", montant, "Dt")

a. Montant : 11 Dt b. Montant : 30 Dt c. Entrée non valide. Veuillez saisir un nombre correcte ! d. Montant : 13 Dt e. Entrée non valide. Veuillez saisir un nombre correcte ! Montant : 0 Dt

This problem has been solved

Similar Questions

Select the correct answerWhat is the output of the code:if (7 < 0) and (0 < -7):  print("vineetha")elif (7 > 0) or False:  print("love")else:  print("codetantra")OptionslovecodetantravineethaError

Choose the Correct Answer(s)What will be the output after the following statements?x = 5 if x > 15: print('yes') elif x == 15: print('equal') else: print('no')Options15equalnoyes

= 0while i < 5: if i == 2: i += 1 continue else: print(i,end = " ") i += 1Options: Pick one correct answer from below0 1 2 3 40 1 3 4Runtime Error1

What will be the output of the following code?for i in range(1,5): if i == 3: continue else: print(i,end = " ")Options: Pick one correct answer from below1 2 3 41 2 41 2 3 4 51 2

What does the following code print if the user enters 15?num = input("Enter a number between 1-100: ")if(num<1 or num>100):     print("Fail: The number is not between 1 and 100 ")else:     print("Thank you for following directions!")print("Thank you for playing!")Group of answer choicesNothing. There is an errorFail: The number is not between 1 and 100Fail: The number is not between 1 and 100 Thank you for playing!Thank you for following directions! Thank you for playing

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.