题目:绘制下面的图形
解析:
考察 turtle 绘制正方形。每次转过的角度都是 90 度。
答案:
不使用循环。
import turtle as t t.fd(100) t.rt(90) t.fd(100) t.rt(90) t.fd(100) t.rt(90) t.fd(100) t.rt(90)
使用循环。
import turtle as t for i in range(0,4): t.fd(100) t.rt(90)
考察 turtle 绘制正方形。每次转过的角度都是 90 度。
不使用循环。
import turtle as t t.fd(100) t.rt(90) t.fd(100) t.rt(90) t.fd(100) t.rt(90) t.fd(100) t.rt(90)
使用循环。
import turtle as t for i in range(0,4): t.fd(100) t.rt(90)