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
8138b6bd
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
0cdcc00d
c71835l760p219a8057/wx092585
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
530 additions
and
15 deletions
Untitled-1.py
diy1.py
奶奶的自述.py
Untitled-1.py
0 → 100644
View file @
8138b6bd
in
=
10
for
i
in
range
(
3
):
day
=
input
(
"今天是几号?"
)
if
day
==
in
:
print
(
"对了"
)
break
\ No newline at end of file
This diff is collapsed.
Click to expand it.
diy1.py
View file @
8138b6bd
# 玩家出拳
s1
=
{
'语文'
:
66
,
'数学'
:
81
,
'英语'
:
52
}
import
random
s2
=
{
'语文'
:
99
,
'数学'
:
88
,
'英语'
:
77
}
player
=
input
(
"你想出什么拳"
)
s3
=
{
'语文'
:
99.999999
,
'数学'
:
89.999999
,
'英语'
:
59.999999
}
print
(
"玩家出的拳是"
+
player
)
score
=
{
'梁志超'
:
s1
,
'奶奶'
:
s2
,
'马保国'
:
s3
}
list
=
[
"石头"
,
"剪刀"
,
"布"
]
name
=
input
(
"请输入的姓名:"
)
computer
=
random
.
choice
(
list
)
if
name
in
score
:
print
(
"计算机出的拳是"
+
computer
)
score_items
=
score
[
name
]
if
player
in
list
:
for
k
,
v
in
score_items
.
items
():
if
player
==
computer
:
print
(
k
,
v
)
print
(
"平局"
)
elif
(
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀"
and
computer
==
"布"
)
or
(
player
==
"布"
and
computer
==
"石头"
):
print
(
"玩家赢了"
)
else
:
print
(
"电脑赢了"
)
else
:
else
:
print
(
"
老八"
)
print
(
"
查无此人"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
奶奶的自述.py
0 → 100644
View file @
8138b6bd
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
x
x
x
x
x
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
This diff is collapsed.
Click to expand it.
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