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
7c56c77f
authored
Dec 13, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
7fca790b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
21.py
21.py
0 → 100644
View file @
7c56c77f
std_dic
=
{
'张三'
:
28
,
'李四'
:
32
,
'王五'
:
45
,
"赵六"
:
50
,
'钱大妈'
:
12
}
std_name
=
input
(
"请输入学生的名字:"
)
std_score
=
int
(
input
(
"请输入学生的分数:"
))
if
std_name
in
std_dic
:
if
std_dic
[
std_name
]
<
std_score
:
std_dic
[
std_name
]
=
std_score
print
(
"恭喜 "
+
std_name
+
" 同学你的分数已经刷新为:"
+
str
(
std_score
))
else
:
print
(
"不好意思"
+
std_name
+
"同学,你的成绩太差,不能更新,继续加油!"
)
else
:
std_dic
[
std_name
]
=
std_score
print
(
"恭喜"
+
std_name
+
"添加进入了班级分数!"
)
print
(
std_dic
)
\ 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