Functions with parameters

In this section you’ll use the Python turtle drawing library to draw some circles, and then use functions and parameters to improve your code.

First you need to import the turtle library and create a Turtle object to draw with. I’ve called mine tina. You can use any name you like, and even have multiple turtle objects with different names.

from turtle import Turtle


tina = Turtle()

To draw a circle with the turtle, you can use the dot function, which takes a diameter (in pixels) as an input parameter.

tina.dot(100)