Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from tkinter import *
  2. from tkinter import ttk
  3. root=Tk()
  4. root.title("BMI")
  5.  
  6.  
  7.  
  8. ttk.Label(root,text= "Weight :").grid(row=0,column=0)
  9. Weight=ttk.Entry(root,width=30,font=('Arial',20)).grid(row=0,column=3)
  10.  
  11. ttk.Label(root,text= "Height :").grid(row=1,column=0)
  12. Height=ttk.Entry(root,width=30,font=('Arial',20)).grid(row=1,column=3)
  13.  
  14. buCalculate=ttk.Button(root,command=buCalculate,text="Calculate").grid(row=2,column=3)
  15.  
  16.  
  17. def buCalculate() :
  18.     x = Weight.get()
  19.     y = Height.get()
  20.     buCalculate = x/y**2
  21. if buCalculate > 18:
  22.     print("")
  23.  
  24.  
  25. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement