how to write python turtle on screen code example
Example 1: create a window turtle python
import turtle
# Create the window
wn = turtle.Screen()
wn.setup(800, 600) # Dimensions
wn.bgcolor("black") # Background color
wn.title("Window") # Title
# Main loop
while True:
window.update() # Update window
Example 2: turtle fillcolor
from turtle import *
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done()