You are on page 1of 3

1)

import math as m

n = int(input("n = "))

l = []

def p(list):

for i in list:

for j in i:

print(j, end=' ')

print()

for i in range(n):

b = [int(i) for i in input().split()]

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)

From tkinter import *

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=Label(frame, text=j, bd=0.5, relief='solid', width=7)

l.grid(row=r, column=c)

c+=1

r+=1

t = Tk()

t.geometry(«300x450»)

t.title('обота з матрицею')

Label(t, text='Введіть матрицю:').place(x=150, y=15)

Text=Text(t, width=42, height=5, bd=3, bg='white', font='Arial 11')


Text.place(x=150, y=55)

B1 = Button(t, text='Додати')

B1.place(x=50, y=85)

E1 = Entry(t, width=20, bd=3)

E1.place(x=150, y=170)

B2 = Button(t, text='Вивести')

B2.place(x=50, y = 200)

E2 = Entry(t, width=20, bd=3)

E2.place(x=150, y=230)

B1.bind('<Button-1>', d)

Frame=Frame(t, bd=0.5, relief='solid')

Frame.place(x=5, y=270)

B2.bind('<Button-1>', vuv)

t.mainloop()

You might also like