from tkinter import *
def button_click():
a = int(str_var1.get())
selection = "Число просте"
arduino
for i in range(2, a):
if (a % i == 0):
selection = "Число не просте"
break
label1.config(text=selection)
root = Tk()
str_var1 = StringVar()
entry1 = Entry(root, textvariable=str_var1)
entry1.pack()
button1 = Button(root, text="Перевірити", command=button_click)
button1.pack()
label1 = Label(root, text="")
label1.pack()
root.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
from tkinter import *
def button_click():
a = int(str_var1.get())
selection = "Число просте"
arduino
for i in range(2, a):
if (a % i == 0):
selection = "Число не просте"
break
label1.config(text=selection)
root = Tk()
str_var1 = StringVar()
entry1 = Entry(root, textvariable=str_var1)
entry1.pack()
button1 = Button(root, text="Перевірити", command=button_click)
button1.pack()
label1 = Label(root, text="")
label1.pack()
root.mainloop()