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
ca7753c1
authored
May 20, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
e1f7fc1a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
diy1.py
diy2.py
diy1.py
View file @
ca7753c1
n
=
input
(
'你叫什么名字啊'
)
import
random
print
(
n
)
player
=
input
(
'请输入老鼠或猫或大象参与游戏:'
)
\ No newline at end of file
print
(
'玩家输入:'
+
player
)
list
=
[
'大象'
,
'猫'
,
'老鼠'
]
com
=
random
.
choice
(
list
)
print
(
'电脑输入:'
+
com
)
if
player
in
list
:
if
player
==
'大象'
and
com
==
'猫'
:
print
(
'玩家赢'
)
elif
player
==
'猫'
and
com
==
'老鼠'
:
print
(
'玩家赢'
)
elif
player
==
'老鼠'
and
com
==
'大象'
:
print
(
'玩家赢'
)
elif
player
==
com
:
print
(
'平局'
)
else
:
print
(
'电脑赢'
)
else
:
print
(
'输入的是什么啊?再仔细看看吧!'
)
diy2.py
0 → 100644
View file @
ca7753c1
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