I just started with turtle and upon writing a basic code which is as follows:
import turtle
srijan_turtle = turtle.Turtle()
srijan_turtle.forward(100)
turtle.done()
I got this error:
srijan_turtle = turtle.Turtle()
AttributeError: partially initialized module 'turtle' has no attribute 'Turtle' (most likely due to a circular import). Did you mean: 'turtle'?
NOTE: The file was saved as turtle.py
Upon searching for a solution regarding the same, I found this
answer over here:
AttributeError: partially initialized module 'turtle' has no attribute 'Turtle' (most likely due to a circular import)
One of the answers there said that:
Simply changing the file name to anything other than, turtle.py would rectify the issue. And it did.
But I did not understand why? Could anyone please explain it to me?