from tkinter import * import random from tkinter import messagebox root = Tk() root.title('prog') root.wm_attributes("-topmost", 1) root.geometry('800x600') n = 0 def click(event): global n n = 1 print('2', random.randint(1, 15)) list = (5, 10 ,15, 20, 25, 30) print('1' , random.choice(list)) but_1 = Button(text='жмяк \n click', width=15, height=5, bg='white', fg='black', activebackground='#77DDE7', activeforeground='#FF2400', font='Hack 16') but_1.bind('<Button-1>', click) but_1.pack() root.mainloop()