Commit 06889f21 by BellCodeEditor

auto save

parent 4ea37e4a
Showing with 23 additions and 0 deletions
'''
print()中如果有多个要输出的内容,且数据类型不一致时(没有办法使用连接符+)可以使用逗号间隔
使用逗号两个输出的数据之间会有一个空格来间隔,使用连接符是没有的
print()函数有一个end参数,可以改变分隔符,默认是\n,换行
ctrl + -
循环嵌套
外层循环执行一次,内层循环会全部执行一轮
'''
#输出5 X 7 = J*I
for i in range(1,10):
for j in range(1,i+1):
print(j,'X',i,'=',j*i,end = ' ')
print()
\ No newline at end of file
for i in range(2):#外层循环 会执行2次
for j in range(3):
print(j*i)
\ No newline at end of file
......@@ -7,6 +7,8 @@ import turtle
pen = turtle.Pen()
# 请创造师在下面接着创作
distance=1
#改变画笔速度
pen.speed(0)
for i in range(300):
pen.forward(distance)
distance+=1
......
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