代码点读机 / Python / turtle.speed

turtle.speed Python · 模块功能

设置海龟移动速度。

怎么用

import turtle
turtle.speed(n)

小例子

import turtle
turtle.speed(5)
print('速度设为5')

运行结果

速度设为5

提醒:0 表示最快。

官方文档:https://docs.python.org/zh-cn/3/library/turtle.html#turtle.speed

在代码里遇到不认识的词?打开代码点读机,点一下就懂 → ← Python全部词条