Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_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
41d44638
authored
Sep 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
eddb6fcf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
1.py
diy1.py
1.py
0 → 100644
View file @
41d44638
N
=
int
(
input
(
'请输奶牛头数:'
))
s
=
20
*
N
*
7
print
(
s
)
\ No newline at end of file
diy1.py
View file @
41d44638
import
random
while
True
list
=
[
"石头"
,
"剪刀"
,
"布"
]
import
random
plier
=
input
(
'请输入:石头,剪刀,布'
)
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list
)
plier
=
input
(
'请输入:石头,剪刀,布'
)
print
(
'玩家输入'
+
plier
)
computer
=
random
.
choice
(
list
)
print
(
'电脑输入'
+
computer
)
print
(
'玩家输入'
+
plier
)
if
plier
in
list
:
print
(
'电脑输入'
+
computer
)
if
computer
==
plier
:
if
plier
in
list
:
print
(
'平局了!'
)
if
computer
==
plier
:
elif
plier
==
'剪刀'
and
computer
==
'布'
:
print
(
'平局了!'
)
print
(
'你赢了!'
)
elif
plier
==
'剪刀'
and
computer
==
'布'
:
elif
plier
==
'石头'
and
computer
==
'剪刀'
:
print
(
'你赢了!'
)
print
(
'你赢了!'
)
elif
plier
==
'石头'
and
computer
==
'剪刀'
:
elif
plier
==
'布'
and
computer
==
'石头'
:
print
(
'你赢了!'
)
print
(
'你赢了!'
)
elif
plier
==
'布'
and
computer
==
'石头'
:
else
:
print
(
'你赢了!'
)
print
(
'电脑赢'
)
else
:
print
(
'输入错误'
)
print
(
'电脑赢'
)
\ No newline at end of file
print
(
'输入错误'
)
\ 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