Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-1
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
0d4f670d
authored
Jul 13, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
3d6c1a33
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
6 deletions
3.py
diy.py
lit.py
quiz.py
www.py
猜拳
3.py
0 → 100644
View file @
0d4f670d
player
=
input
(
"请出拳(石头|剪刀|布):"
)
print
(
"玩家出拳"
+
player
)
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
choice
(
list
)
print
(
"电脑出拳:"
+
computer
)
if
player
==
computer
:
print
(
"平局了"
)
elif
(
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀 and computer=="
布
")or(player=="
布
" and computur=="
石头
")
print("
你
TM
赢了
")
else:
print("
你
TM
输了
")
\ No newline at end of file
diy.py
0 → 100644
View file @
0d4f670d
import
random
player
=
input
(
"请出拳(石头|剪刀|布):"
)
print
(
"玩家出拳"
+
player
)
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
choice
(
list
)
print
(
"电脑出拳:"
+
computer
)
if
player
==
computer
:
print
(
"平局了"
)
elif
(
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀 and computer=="
布
")or(player=="
布
" and computur=="
石头
")
print("
你
TM
赢了
")
else:
print("
你
TM
输了
")
lit.py
0 → 100644
View file @
0d4f670d
quiz.py
View file @
0d4f670d
# 直接运行以下代码,说说你的发现:
import
random
list_hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
player
=
input
(
"请出拳(石头|剪刀|布):"
)
dict_hero
=
{
'赵一'
:
30
,
'丁二'
:
37
,
'孙五'
:
52
,
'王猛'
:
89
,
'周亮'
:
98
}
print
(
"玩家出拳"
+
player
)
print
(
len
(
list_hero
))
print
(
len
(
dict_hero
))
list
=
[
"石头"
,
"剪刀"
,
"布"
]
\ No newline at end of file
computer
=
random
choice
(
list
)
print
(
"电脑出拳:"
+
computer
)
if
player
==
computer
:
print
(
"平局了"
)
elif
(
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀 and computer=="
布
")or(player=="
布
" and computur=="
石头
")
print("
你
TM
赢了
")
else:
print("
你
TM
输了
")
www.py
0 → 100644
View file @
0d4f670d
import
random
player
=
input
(
"请出拳(石头|剪刀|布):"
)
print
(
"玩家出拳"
+
player
)
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
choice
(
list
)
print
(
"电脑出拳:"
+
computer
)
if
player
==
computer
:
print
(
"平局了"
)
elif
(
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀 and computer=="
布
")or(player=="
布
" and computur=="
石头
")
print("
你
TM
赢了
")
else:
print("
你
TM
输了
")
猜拳
0 → 100644
View file @
0d4f670d
player=input("请出拳(石头|剪刀|布):")
print("玩家出拳"+player)
list=["石头","剪刀","布"]
computer=random choice(list)
print("电脑出拳:"+computer)
if player==computer:
print("平局了")
elif (player=="石头" and computer=="剪刀") or (player=="剪刀 and computer=="布")or(player=="布" and computur=="石头")
print("你TM赢了")
else:
print("你TM输了")
\ 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