Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-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
e14cb5cb
authored
Oct 17, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
3fe49f07
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
22 deletions
1.py
cfg.py/name
cfg.py/了
diy1.py
1.py
0 → 100644
View file @
e14cb5cb
name
=
'刘强'
power
=
66
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
1
and
hero
[
i
]
>=
power
:
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
break
print
(
hero
)
cfg.py/name
0 → 100644
View file @
e14cb5cb
cfg.py/了
0 → 100644
View file @
e14cb5cb
++ "b/cfg.py/\344\272\206"
diy1.py
View file @
e14cb5cb
import
random
a
=
input
(
"请输入姓名"
)
list
=
[
"石头"
,
"剪刀"
,
"布"
]
b
=
input
(
"请输入成绩"
)
computer
=
random
.
choice
(
list
)
print
(
a
+
"的英语成绩"
+
b
)
print
(
computer
)
\ No newline at end of file
player
=
input
(
"请出拳"
)
print
(
"玩家出拳"
+
player
)
if
player
==
computer
:
print
(
"平局"
)
elif
player
==
"剪刀"
and
computer
==
"布"
:
print
(
"玩家胜利"
)
elif
player
==
"石头"
and
computer
==
"剪刀"
:
print
(
"玩家胜利"
)
elif
player
==
"布"
and
computer
==
"石头"
:
print
(
"玩家胜利"
)
else
:
print
(
"玩家失败"
)
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