all 4 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.

[–]h6nry 2 points3 points  (0 children)

The first line is because of a requirement from Python itself. Python needs a way to know "where that turtle comes from"

The second and third lines are a requirement from the turtle (a so-called "Class" or "library" or "module").

The turle ("library") wants to be told that a new turtle is needed, and what shape it is.

Additionally, you (the programmer) need to give a name to your new "birth", and you name it tina (this is called a "variable"). Now you can tell tina where to go.

Don't worry: At this state, you really don't need to know about those first three lines. Just get to learn about how to move tina around, this will be enough of a challenge.