Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_2
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
9ca901cd
authored
2 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e6e7a0d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
diy2.py
diy2.py
View file @
9ca901cd
dict
+
{
'可乐可口'
:
3
,
'旺一旺牛奶'
:
4
,
'九转大肠'
:
12
,
'腐肉'
:
1
}
k
=
input
(
'你想买什么?'
)
if
k
in
dict
:
print
(
'叮咚~您的'
+
k
+
)
\ No newline at end of file
score
=
{
'可乐'
:
63
,
'牛奶'
:
94
,
'大肠'
:
92
,
'日你妈'
:
81
}
k
=
input
(
'请输入您的姓名:'
)
v
=
input
(
'请输入你的最新成绩:'
)
if
k
in
score
:
if
int
(
v
)
>
score
[
k
]:
score
[
k
]
=
int
(
v
)
print
(
k
+
'同学,恭喜你成功更新为'
+
v
+
'分'
)
else
:
print
(
k
+
'同学,遗憾的通知你,成绩未被刷新'
)
else
:
score
[
k
]
=
int
(
v
)
print
(
'亲爱的'
+
k
+
'同学,您的前第一次'
+
v
+
'分'
)
\ No newline at end of file
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