• Предмет: Информатика
  • Автор: Аноним
  • Вопрос задан 2 месяца назад

Помагите пжпжпжпж...... даю 90 балов. в пайтоне from tkinter import* root = Tk() root.title("Середньодобова температура за тиждень") canvas = Canvas(root, width = 300, height = 220) canvas.pack() a = [14, 12, 15, 12, 9, 10, 7] # Побудова координатних осей canvas.create_line(10, 200, 10, 10, arrow = LAST, arrowshape = "10 20 10") canvas.create_line(10, 200, 280, 200, arrow = LAST, arrowshape = "10 20 10") day = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Нд'] x1 = 30 y1 = 220–a[0]*10 canvas.create_text(x1, 210, text = day[0], anchor = W) canvas.create_text(x1, y1–10, text = str(a[0]), anchor = W, font = "Arial 12") for i in range(1, 7): x = x1+30 y = 220–a[i]*10 canvas.create_line(x1, y1, x, y, width = 2) canvas.create_text(x, 210, text = day[i], anchor = W) canvas.create_text(x, y–10, text = str(a[i]), anchor = W, font = "Arial 12") x1 = x y1 = y ​

Приложения:

Ответы

Ответ дал: nikita3402
0

Ответ:

from tkinter import*

root = Tk()

root.title("Середньодобова температура за тиждень")

canvas = Canvas(root, width=300, height=220)

canvas.pack()

a = [14, 12, 15, 12, 9, 10, 7]  # Побудова координатних осей

canvas.create_line(10, 200, 10, 10, arrow=LAST, arrowshape="10 20 10")

canvas.create_line(10, 200, 280, 200, arrow=LAST, arrowshape="10 20 10")

day = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Нд']

x1 = 30

y1 = 220 - a[0] * 10

canvas.create_text(x1, 210, text=day[0], anchor=W)

canvas.create_text(x1, y1 - 10, text=str(a[0]), anchor=W, font="Arial 12")

for i in range(1, 7):

   x = x1 + 30

   y = 220 - a[i] * 10

   canvas.create_line(x1, y1, x, y, width=2)

   canvas.create_text(x, 210, text=day[i], anchor=W)

   canvas.create_text(x, y - 10, text=str(a[i]), anchor=W, font="Arial 12")

   x1 = x

   y1 = y

root.mainloop()

Объяснение:

Вас заинтересует