Professional Documents
Culture Documents
import math as m
n = int(input("n = "))
l = []
def p(list):
for i in list:
for j in i:
print()
for i in range(n):
l+=[b]
l1 = []
for i in l:
b = [int(j**2) for j in i]
l1+=[b]
p(l1)
a = int(input('a = '))
l2 = []
for i in l:
b = [int(j+a) for j in i]
l2+=[b]
p(l2)
l3 = []
for i in l:
b = [float(m.sqrt(j)) for j in i]
l3+=[b]
p(l3)
y = int(input('y = '))
l4 = []
for i in l3:
b = [round(j, y) for j in i]
l4+=[b]
p(l4)
2)
A=[]
Def d(event):
B=text.get('1.0', END).split()
Global a
A = a + [b]
Text.delete('1.0', END)
Def vuv(event):
R=0
E01=e1.get()
E02=int(e2.get())
For i in a:
C=0
For j in i:
J = float(j)/float(e01)
J = round(j, e02)
l.grid(row=r, column=c)
c+=1
r+=1
t = Tk()
t.geometry(«300x450»)
t.title('обота з матрицею')
B1 = Button(t, text='Додати')
B1.place(x=50, y=85)
E1.place(x=150, y=170)
B2 = Button(t, text='Вивести')
B2.place(x=50, y = 200)
E2.place(x=150, y=230)
B1.bind('<Button-1>', d)
Frame.place(x=5, y=270)
B2.bind('<Button-1>', vuv)
t.mainloop()