Set a max distance

I wanna know if I can set a max distance to a turtle go.

for i in range(130):
	alex.forward(randint(5,10))
	tess.forward(randint(5,10))
	tim.forward(randint(5,10))
	duck.forward(randint(5,10))
	dog.forward(randint(5,10))

In this code I wanna make that the turtle don’t go more than 1000 forward. How can I do that?
I researched this subject but could not find anything.

Someone knows???