+100
1 год назад
Информатика
10 - 11 классы
import tkinter as tk
def draw_brick_sign(canvas):
# Draw outer red circle
canvas.create_oval(100, 100, 300, 300, outline="red", width=5)
# Draw inner white circle
canvas.create_oval(110, 110, 290, 290, outline="white", width=5)
# Draw white rectangle inside the sign
canvas.create_rectangle(130, 180, 270, 220, fill="white")
# Create a 400x400 canvas
root = tk.Tk()
canvas = tk.Canvas(root, width=400, height=400)
canvas.pack()
# Draw the brick sign on the canvas
draw_brick_sign(canvas)
root.mainloop()
import tkinter as tk
def draw_brick_sign(canvas):
# Draw outer red circle
canvas.create_oval(100, 100, 300, 300, outline="red", width=5)
# Draw inner white circle
canvas.create_oval(110, 110, 290, 290, outline="white", width=5)
# Draw white rectangle inside the sign
canvas.create_rectangle(130, 180, 270, 220, fill="white")
# Create a 400x400 canvas
root = tk.Tk()
canvas = tk.Canvas(root, width=400, height=400)
canvas.pack()
# Draw the brick sign on the canvas
draw_brick_sign(canvas)
root.mainloop()