Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_DIY1
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
9c3f71fc
authored
Sep 17, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c256c561
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
diy1.py
sun_flower.py
diy1.py
View file @
9c3f71fc
# 我们都爱夸夸夸
\ No newline at end of file
# 我们都爱夸夸夸
a
=
input
(
"请输入:"
)
print
(
"玩家:"
+
a
)
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
if
a
in
list
:
b
=
random
.
choice
(
list
)
print
(
"计算机:"
+
b
)
if
(
a
==
b
):
print
(
"平局"
)
elif
(
a
==
"石头"
and
b
==
"布"
)
or
(
a
==
"布"
and
b
==
"剪刀"
)
or
(
a
==
"剪刀"
and
b
==
"石头"
):
print
(
"计算机赢"
)
else
:
print
(
"玩家赢"
)
else
:
print
(
"请输入正确格式"
)
sun_flower.py
0 → 100644
View file @
9c3f71fc
#导入模块
import
turtle
#背景颜色
turtle
.
Screen
()
.
bgcolor
(
"pink"
)
#创建画笔
p
=
turtle
.
Pen
()
#起笔
p
.
penup
()
#改变画笔位置
p
.
goto
(
100
,
150
)
#落笔
p
.
pendown
()
#改变画笔颜色
c
=
input
(
"请输入颜色:"
)
p
.
color
(
c
)
#改变画笔速度
p
.
speed
(
1000
)
p
.
fillcolor
(
"yellow"
)
#开始填充
p
.
begin_fill
()
#循环36
for
i
in
range
(
36
):
#画笔的移动
p
.
forward
(
200
)
#旋转
p
.
left
(
170
)
#结束填充
p
.
end_fill
()
#隐藏画笔
p
.
hideturtle
()
#保存画布
turtle
.
done
()
\ No newline at end of file
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