Skip main navigation

Python Turtle

Python Turtle
Run and modify the following “while-turtle.py” and share your experiences with others.

import turtle
import time

window = turtle.Screen()

length = 200
turtle.color("red","yellow")
turtle.pensize(2)
turtle.begin_fill()
while True:
turtle.forward(300)
turtle.right(170)
if abs(turtle.pos()) < 1:
break
turtle.end_fill()
time.sleep(5)
This article is from the free online

Recommender Systems in Python

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now