Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter, sys, random
- from tkinter import messagebox
- def zmiana():
- global liczba
- liczba = random.randint(1, s.get())
- def koniec():
- sys.exit()
- def sprawdz():
- x = int(e.get())
- if x>liczba:
- messagebox.showinfo(title = "Uwaga", message = "Moja liczba jest mniejsza od Twojej")
- if x <liczba:
- messagebox.showinfo(title = "Uwaga", message = "Moja liczba jest większa od Twojej")
- if x == liczba:
- messagebox.showinfo(title = "Gratulacje", message = "Brawo zgadl‚es")
- def nowagra():
- liczba = random.randint(1, s.get())
- x = 0
- l.config(text = "")
- random.seed()
- main = tkinter.Tk()
- liczba = random.randint(1, s.get)
- x = 0
- e = tkinter.Entry(main, justify = "center")
- l = tkinter.Label(main, text = "Posuwając suwakiem zmień zakres liczb")
- b = tkinter.Button(main, text = "Zakończ", command = koniec)
- b2 = tkinter.Button(main, text = "Sprawdz", command = sprawdz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement