猫史档案馆


【Python作品分享】新的作品-47【作品秀】

用户:庄泽铭庄泽铭查看:0 回复:1 评论:0 创建时间:2021-08-14T15:36:33


【作品展示】

center_image

 

【作品介绍】

乘法表

 

【作品源代码】

import turtle
screen = turtle.Screen()
screen.title("乘法表")
size = screen.window_height()
a = turtle.Pen()
a.speed(0)
a.hideturtle()
a.penup()
q = 1
w = 1

a.goto(-size, size/2)
a.pendown()

def function1(one, two):
    c = one ,'*', two,'=', one*two
    a.penup()
    a.pendown()
    a.write(c, font=("文泉驿正黑", 10), align='right')
    a.penup()
    a.forward(200)


turtle.bgcolor("#996633")
for i in range(45):
    for i in range(9):
        function1(q, w)
        w += 1
    a.forward(-1800)
    a.right(90)
    a.forward(20)
    a.left(90)
    q += 1
    w = 1
turtle.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
庄泽明庄泽明

()

点赞0


评论