This is an old revision of the document!
5+9 print („Tere Kevad”) 56/5+99-14*9 print („Tere Kevad”) 3 > 7 for x in range (1,10): print (x)
kaal = float(input("Kui palju sa umbes kaalud? ")) if kaal > 100: print("Tõenäoliselt oled natuke ülekaaluline.") elif kaal >50: print("OK või käib küll") else: print ("Oled alakaaluline või paremal juhul laps")
import tkinter as tk class Application(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.pack() self.createWidgets() def createWidgets(self): self.hi_there = tk.Button(self) self.hi_there["text"] = "Olen aknaga programm\n(vajuta siia)" self.hi_there["command"] = self.say_hi self.hi_there.pack(side="top") self.QUIT = tk.Button(self, text="SULGE", fg="red",command=root.destroy) self.QUIT.pack(side="bottom") def say_hi(self): print("Tere kevad!") root = tk.Tk() app = Application(master=root) root.geometry("250x150+300+300") app.mainloop()