gpt-3.5-turbo-0125· OpenAI
WildChat-4.8M (AI2)
Write a python turtle code for making a star inside a box
- User
Write a python turtle code for making a star inside a box
- Assistant
import turtle
Set up turtle
t = turtle.Turtle()
Draw a box
t.penup() t.goto(-100, 100) t.pendown() for _ in range(4): t.forward(200) t.right(90)
Draw a star inside the box
t.penup() t.goto(0, 100) t.pendown() t.fillcolor("yellow") t.begin_fill() for _ in range(5): t.forward(150) t.right(144) t.end_fill()
Hide turtle and display the window
t.hideturtle() turtle.done()