NOC - python(每日一题)

NOC - python(每日一题)

【参考答案】

import turtle as t

t.forward(200)

t.right(90)

t.forward(200)

t.right(90)

t.forward(200)

t.right(90)

t.forward(200)

t.right(90)

t.fillcolor('black')

t.begin_fill()

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.end_fill()

t.goto(200,-200)

t.right(-90)

t.fillcolor('black')

t.begin_fill()

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.end_fill()

t.done()

【参考答案】