This problem occurred to me quite recently. I have no idea what i am doing wrong due to me being a beginner in python. If anyone is interested I am using a Raspberry pi 400 and I am using VSC but anyways here is my code:
import turtle
import random
pat=turtle.Turtle()
colours=["orange","blue","red","yellow", "cyan"]
turtle.Screen().bgcolor("black")
for i in range(200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000):
for i in range(2):
pat.forward(300)
pat.right(100)
pat.right(100)
pat.forward(300)
pat.right(100)
pat.left(5)
pat.color(random.choice(colours))