Dec-11-2020, 03:31 PM
What does turtle.Turtle() actually do?
I am trying to follow this tutorial on youtube:
https://www.youtube.com/watch?v=crV6T3piwHQ
You can see that the author first generates the screen with turtle.Screen(). Only after doing that does he call turtle.Turtle() to use the rest of functionalities of that module. In some other modules I have come across with, we always call the name.Name() first in order to have access to all functionalities listed in dir(module). But in this case, it wasn't the first thing that was called. That made me question, what does that line actually do? Not only in turtle module, but generally - when we call module.Module(). If this is too fundamental of a question, what is it that I am not understanding correctly? Is it python syntax? or is it more module specific?
Thank you.
I am trying to follow this tutorial on youtube:
https://www.youtube.com/watch?v=crV6T3piwHQ
You can see that the author first generates the screen with turtle.Screen(). Only after doing that does he call turtle.Turtle() to use the rest of functionalities of that module. In some other modules I have come across with, we always call the name.Name() first in order to have access to all functionalities listed in dir(module). But in this case, it wasn't the first thing that was called. That made me question, what does that line actually do? Not only in turtle module, but generally - when we call module.Module(). If this is too fundamental of a question, what is it that I am not understanding correctly? Is it python syntax? or is it more module specific?
Thank you.