Ответ:
Python
from tkinter import *
def calculation():
n=int(txt_n.get())
d=int(txt_d.get())
m=int(txt_m.get())
S=0
P=1
for i in range (1,5):
S+=(i+4)
for i in range (1,4):
P*=(i+n)
res=m*((S+d)/P)
res_y.configure(text='y = {}'.format(res))
window = Tk()
window.title("For Tattybaeva Merei")
window.geometry('300x100')
lbl_m = Label(window, text="m=").grid(column=0, row=0)
txt_m = Entry(window,width=10)
txt_m.grid(column=1, row=0)
lbl_d = Label(window, text="d=").grid(column=0, row=1)
txt_d = Entry(window,width=10)
txt_d.grid(column=1, row=1)
lbl_n = Label(window, text="n=").grid(column=0, row=2)
txt_n = Entry(window,width=10)
txt_n.grid(column=1, row=2)
btn = Button(window, text="Считать", command=calculation)
btn.grid(column=4, row=2)
res_y = Label(window)
res_y.grid(column=5, row=2)
window.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
Python
from tkinter import *
def calculation():
n=int(txt_n.get())
d=int(txt_d.get())
m=int(txt_m.get())
S=0
P=1
for i in range (1,5):
S+=(i+4)
for i in range (1,4):
P*=(i+n)
res=m*((S+d)/P)
res_y.configure(text='y = {}'.format(res))
window = Tk()
window.title("For Tattybaeva Merei")
window.geometry('300x100')
lbl_m = Label(window, text="m=").grid(column=0, row=0)
txt_m = Entry(window,width=10)
txt_m.grid(column=1, row=0)
lbl_d = Label(window, text="d=").grid(column=0, row=1)
txt_d = Entry(window,width=10)
txt_d.grid(column=1, row=1)
lbl_n = Label(window, text="n=").grid(column=0, row=2)
txt_n = Entry(window,width=10)
txt_n.grid(column=1, row=2)
btn = Button(window, text="Считать", command=calculation)
btn.grid(column=4, row=2)
res_y = Label(window)
res_y.grid(column=5, row=2)
window.mainloop()