commit e67ab31c58fd9e042b1190a22df4b1a2be319325 Author: marvyn.meunier Date: Tue Mar 14 21:07:59 2023 +0100 push diff --git a/projet 8 NSI.py b/projet 8 NSI.py new file mode 100644 index 0000000..085cc99 --- /dev/null +++ b/projet 8 NSI.py @@ -0,0 +1,42 @@ +from tkinter import * + + +def IMC(): + valeur = value.get() + valeur2 = value2.get() + imc = valeur / (valeur2*0.01)**2 + label.configure(text="Cela donne "+str(imc)+" IMC") + +fenetre = Tk() +fenetre.title('Calcul de IMC') +fenetre.configure(bg='#988080') + +expliquation = Label(fenetre, text="Cette fenĂȘtre permets de donner votre IMC ", bg='#988080') +expliquation.grid(row =1, column=0, columnspan=3) + +fonction = Label(fenetre, text="donner votre poids (kg) :", bg='#988080') +fonction.grid(row=2, column=0, columnspan=1) + +fonction = Label(fenetre, text="donner votre taille (cm) :", bg='#988080') +fonction.grid(row=2, column=2, columnspan=3) + +value = IntVar() +value.set(0) + +entree = Entry(fenetre, textvariable=value, width=30) +entree.grid(row=3, column=0) + +value2 = IntVar() +value2.set(0) + +entree2 = Entry(fenetre, textvariable=value2, width=30) +entree2 .grid(row=3, column=2) + +Button(text="donner IMC", bg='#89BCB6', command=IMC).grid(row=5, column=1 ,columnspan=1) + + +label = Label(fenetre, text="'resultat de IMC'") +label.grid(row=4, column = 1,columnspan=1) + + +fenetre.mainloop() \ No newline at end of file