Python绘制金字塔

# pyramid

import turtle as t

t.pencolor("gold")
t.pensize(2)

count = 10

while count > 0:
    for i in range(count):
        t.fd(10)
        for j in range(4):
            t.left(90)
            t.fd(10)  
    t.fd(-(count*10))
    t.left(90)
    t.fd(10)
    t.right(90)
    t.fd(5)
    count -=1
        
 
t.done()

全部评论

相关推荐

牛客21331815...:像我一投就pass,根本不用焦虑泡池子
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务