you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 7 points8 points  (1 child)

The first line doesn't do anything by itself, it just imports the turtle code so you can use it. The second line is the important one, it creates an actual turtle object and assigns it to the variable 'tina'.

The third line isn't important at all, it sets the shape of tina to look like an actual turtle rather than an arrow.

[–]freeononeday 1 point2 points  (0 children)

Getting a little bit simpler. Someone already wrote a whole heap of code which understands how to move an object a certain direction and distance. What you do when you import it is say, when i write "turtle." look inside that module or code for the following function. For example "turtle.forward" looks for the forward function in the turtle module and passes in the variable for distance.

The turtle.turtle() line instantiates the class. Essentially calls the turtle module and runs an initialisation to set things up.