import turtle
screen = turtle.Screen()
screen.title("Светофор")
screen.setup(width=500, height=500)
t = turtle.Turtle()
t.hideturtle()
t.speed(0)
word = screen.textinput("Светофор", "Введите цвет (красный, жёлтый, зелёный):")
if word:
word = word.strip().lower()
if word == "красный":
t.dot(100, "red")
t.write("Стой", align="center", font=("Arial", 24, "bold"))
elif word == "жёлтый" or word == "желтый":
t.dot(100, "yellow")
t.write("Жди", align="center", font=("Arial", 24, "bold"))
elif word == "зелёный" or word == "зеленый":
t.dot(100, "green")
t.write("Иди", align="center", font=("Arial", 24, "bold"))
else:
t.write("Такого сигнала нет", align="center", font=("Arial", 20, "normal"))
turtle.done()