Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-5
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
33619d80
authored
Jun 03, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d9d64250
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
score.py
score.py
0 → 100644
View file @
33619d80
score
=
{
"张三"
:
35
,
"李四"
:
90
,
"王五"
:
78
,
"赵六"
:
59
,
"郑七"
:
98
}
# 成绩单字典
n
=
input
(
"请输入你的名字:"
)
#输入名字
s
=
input
(
"请输入你的成绩:"
)
#输入成绩
if
n
in
score
:
#如果输入的名字在字典里
if
int
(
s
)
>
score
[
n
]:
#如果输入的成绩大于之前的成绩
score
[
n
]
=
int
(
s
)
#把输入的成绩替换原来的成绩
print
(
score
)
#打印字典
else
:
#否则
score
[
n
]
=
int
(
s
)
#把输入的成绩存储到字典
print
(
score
)
#打印字典
\ 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