Commit c37b6327 by BellCodeEditor

save project

parent 97f07dce
Showing with 23 additions and 4 deletions
i = 1 # 行
j = 0 # 列
# 使用变量i和j,代替乘法算式里面的元素,打印出单个乘法算式
#
def write(a):
p.write(a,font=("Times",15,"normal"))
p.forward(10)
import turtle
p=turtle.Pen()
p.penup()
p.goto(-200,-200)
for i in range(1,10):
for j in range(1,i+1):
print(j,"x",i,"=",(i*j),end="|")
print()
\ No newline at end of file
j2=str(j)
i2=str(i)
ji=str(j*i)
p.goto(-200+j*80,200-i*40)
write(j2)
write("x")
write(i2)
write("=")
write(ji)
p.hideturtle()
turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment