Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-2_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
517c182d
authored
Nov 28, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
35e54b35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
1.py
3.py
star.py
1.py
0 → 100644
View file @
517c182d
if
elif
else
if
else
\ No newline at end of file
3.py
0 → 100644
View file @
517c182d
#玩家出拳
p
=
input
(
"请输入玩家出的内容"
)
print
(
"Player:"
+
p
)
#计算机出拳
#1.导入random模块
import
random
#2.创建一个列表
list
=
[
"石头"
,
"剪刀"
,
"布"
]
c
=
random
.
choice
(
list
)
print
(
"computer:"
+
c
)
#判断输赢
if
p
in
list
:
if
c
==
p
:
print
(
"平局"
)
elif
(
p
==
"石头"
and
c
==
"剪刀"
)
or
(
p
==
"剪刀"
and
c
==
"布"
)
or
(
p
==
"布"
and
c
==
"石头"
):
print
(
"玩家胜利"
)
else
:
print
(
"计算机胜利"
)
else
:
print
(
"输入有误"
)
\ No newline at end of file
star.py
View file @
517c182d
# 上节课你是这样绘制的五角星👇:
# 这节课你可以利用新学的知识自定义五角星的颜色么?
import
turtle
color
=
input
(
"请输入颜色"
)
pen
=
turtle
.
Pen
()
pen
.
fillcolor
(
"red"
)
#内部填充红色
pen
.
fillcolor
(
color
)
#内部填充红色
#绘制五角星#
pen
.
begin_fill
()
for
i
in
range
(
5
):
#重复执行5次
...
...
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