题目:绘制下面的图形

python turtle 100-16
Python 海龟绘图 100 题——第 16 题

解析:

综合应用,绘制有对角线的正方形。

答案:

不用循环
Python
import turtle as t
t.fd(100)
t.rt(90)
t.fd(100)
t.home()
t.rt(90)
t.fd(100)
t.undo()
t.lt(90)
t.fd(100)
使用循环
Python
import turtle as t
for i in range(0,6):
    t.fd(100)
    t.rt(90)
t.home()