Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson1_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
75ca2e01
authored
Sep 23, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a1496b3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
diy1.py
hello.py
huigu.py
diy1.py
0 → 100644
View file @
75ca2e01
player
=
input
(
"请输入(石头/剪刀/布):"
)
print
(
"玩家出拳:"
+
player
)
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list
)
print
(
"计算机出拳:"
+
computer
)
if
player
in
list
:
if
player
==
compuifter
:
print
(
"平局"
)
elif
(
player
==
"石头"
and
computer
==
"布"
)
or
(
player
==
"布"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀"
and
computer
==
"石头"
):
print
(
"计算机赢"
)
else
:
print
(
"玩家赢"
)
else
:
print
(
"请重新输入"
)
hello.py
View file @
75ca2e01
print
(
"Hello World!"
)
\ No newline at end of file
huigu.py
0 → 100644
View file @
75ca2e01
#导入模块
import
turtle
#创建画笔
p
=
turtle
.
Pen
()
#创建屏幕
s
=
turtle
.
Screen
()
#改变屏幕背景颜色
s
.
bgcolor
(
"red"
)
#起笔
p
.
penup
()
#改变画笔位置
p
.
goto
(
100
,
150
)
#落笔
p
.
pendown
()
#改变画笔速度
p
.
speed
(
1000
)
#改变画笔颜色
p
.
pencolor
(
"red"
)
#改变画笔形状
p
.
shape
(
"circle"
)
#填充颜色
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