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
28255355
authored
Apr 23, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
1f7bd3d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
31 deletions
diy1.py
jk.py
diy1.py
View file @
28255355
player
=
input
(
"请出拳:石头/剪刀/布"
)
print
(
"玩家出拳:"
+
player
)
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list
)
print
(
computer
)
if
player
in
list
:
if
player
==
computer
:
print
(
"平局"
)
elif
player
==
"石头"
and
computer
==
"剪刀"
:
print
(
"恭喜你赢了"
)
elif
player
==
"剪刀"
and
computer
==
"布"
:
print
(
"恭喜你赢了"
)
elif
player
==
"布"
and
computer
==
"石头"
:
print
(
"恭喜你赢了"
)
else
:
print
(
"很遗憾你输了"
)
else
:
print
(
"输入错误"
)
\ No newline at end of file
machine
=
{
'农夫三拳'
:
3
,
'口渴可乐'
:
3
,
'狗崽牛奶'
:
4
,
'纳条'
:
3
,
'巴东尻油'
:
2
,
'没直之'
:
4
,
'奥里给'
:
4
,
'乐不思薯'
:
5
,
'还害嗨'
:
6
}
b
=
goods
.
pop
(
'农夫三拳'
)
a
=
goods
.
clear
()
print
(
b
)
print
(
a
)
del
goods
\ No newline at end of file
jk.py
View file @
28255355
if
player
==
computer
:
print
(
"平局"
)
elif
player
==
"石头"
and
computer
==
"剪刀"
:
print
(
"恭喜,你赢了"
)
elif
player
==
"剪刀"
and
computer
==
"布"
:
print
(
"恭喜,你赢了)
elif player=="
布
"and computer=="
石头
":
print("
恭喜你,你赢了
")
else:
print("
很遗憾,你输了
")
\ No newline at end of file
score
=
{
'monky'
:{
'天书'
:
91
,
'输血'
:
88
,
'银阁里希'
:
85
},
'noi'
:{
'天书'
:
99
,
'输血'
:
96
,
'银阁里希'
:
90
},
'beanbean'
:{
'天书'
:
91
,
'输血'
:
90
,
'银阁里希'
:
12
}}
while
True
:
print
(
'请输入要揍得人的名字,退出请按w'
)
str
=
input
(
'你要揍扁谁?'
)
if
str
in
score
:
m
=
score
[
str
]
print
(
str
+
'同学的罪证如下'
)
for
k
,
v
in
m
.
items
():
print
(
k
,
v
)
print
(
'**********************'
)
elif
str
==
'w'
:
break
else
:
print
(
'哈哈哈差个成绩都不会煞笔煞笔,再输'
)
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