Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson5_1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
06889f21
authored
Oct 02, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4ea37e4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
1.py
3.py
diy1.py
1.py
0 → 100644
View file @
06889f21
'''
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
3.py
0 → 100644
View file @
06889f21
for
i
in
range
(
2
):
#外层循环 会执行2次
for
j
in
range
(
3
):
print
(
j
*
i
)
\ No newline at end of file
diy1.py
View file @
06889f21
...
...
@@ -7,6 +7,8 @@ import turtle
pen
=
turtle
.
Pen
()
# 请创造师在下面接着创作
distance
=
1
#改变画笔速度
pen
.
speed
(
0
)
for
i
in
range
(
300
):
pen
.
forward
(
distance
)
distance
+=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment