Difference between turtle and Turtle?

后端 未结 5 1138
粉色の甜心
粉色の甜心 2021-01-22 20:16

How are turtle and Turtle different from each other in python version 2.7?

import turtle
star = turtle.Turtle()
for i in ran         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-22 20:51

    turtle is the name of the package while Turtle is the name of the class.

    An alternate way of importing the module would be:

    import turtle.Turtle

    Also, are you sure the last line is turtle.done() and not star.done()?

提交回复
热议问题