Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-3-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
08aaf48d
authored
Apr 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e5f6b2e4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
300 additions
and
9 deletions
1.py
2.py
aaa.py
1.py
deleted
100644 → 0
View file @
e5f6b2e4
'''
a=input("你出什么?")
input("玩家出拳:"+a)
'''
import
random
input
(
computer
)
a
=
[
"布"","
剪刀
","
石头
"]
computer=random.choice(a)
\ No newline at end of file
2.py
0 → 100644
View file @
08aaf48d
p
=
input
(
"你要出什么"
)
print
(
"玩家出"
+
p
)
import
random
asd
=
[
"石头"
,
"剪刀"
,
"布"
]
c
=
random
.
choice
(
asd
)
print
(
"电脑出"
+
c
)
if
c
==
p
:
print
(
"平局"
)
elif
p
==
"石头"
and
c
==
"剪刀"
:
print
(
"玩家赢"
)
elif
p
==
"剪刀"
and
c
==
"布"
:
print
(
"玩家赢"
)
elif
p
==
"布"
and
c
==
"石头"
:
print
(
"玩家赢"
)
else
:
print
(
"电脑赢了"
)
\ No newline at end of file
aaa.py
0 → 100644
View file @
08aaf48d
while
True
:
p
=
input
(
"你要出什么"
)
print
(
"玩家出"
+
p
)
import
random
asd
=
[
"石头"
,
"剪刀"
,
"布"
]
c
=
random
.
choice
(
asd
)
print
(
"电脑出"
+
c
)
if
c
==
p
:
print
(
"平局"
)
elif
p
==
"石头"
and
c
==
"剪刀"
:
print
(
"玩家赢"
)
elif
p
==
"剪刀"
and
c
==
"布"
:
print
(
"玩家赢"
)
elif
p
==
"布"
and
c
==
"石头"
:
print
(
"玩家赢"
)
elif
c
==
"石头"
and
p
==
"剪刀"
:
print
(
"电脑赢"
)
elif
c
==
"剪刀"
and
p
==
"布"
:
print
(
"电脑赢"
)
elif
c
==
"布"
and
p
==
"石头"
:
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