Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_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
426a3875
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
5ab88987
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
diy2.py
diy2.py
View file @
426a3875
score
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
s1
=
{
'语文'
:
79
,
'数学'
:
"88+10"
,
'英语'
:
95
}
s2
=
{
'语文'
:
75
,
'数学'
:
"98+10"
,
'英语'
:
91
}
s3
=
{
'语文'
:
71
,
'数学'
:
"87+10"
,
'英语'
:
75
}
s4
=
{
'语文'
:
61
,
'数学'
:
"88+10"
,
'英语'
:
75
}
s5
=
{
'语文'
:
87
,
'数学'
:
"94+18"
,
'英语'
:
92
}
s6
=
{
'语文'
:
71
,
'数学'
:
"88+20"
,
'英语'
:
75
}
s7
=
{
'语文'
:
81
,
'数学'
:
"97+20"
,
'英语'
:
97
}
score
=
{
"1号"
:
s1
,
"2号"
:
s2
,
"3号"
:
s3
,
"4号"
:
s4
,
"5号"
:
s5
,
"6号"
:
s6
,
"7号"
:
s7
}
while
True
:
name
=
input
(
"请输入查询学号,退出请按“q”:"
)
if
name
in
score
:
print
(
'*'
*
50
)
info
=
score
[
name
]
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
print
(
'*'
*
50
)
elif
name
==
'q'
:
print
(
"查询以退出。"
)
break
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
else
:
print
(
"输入错误,请重新输入!!!
\n
注意:只可查询1~7号的成绩,数字后请加‘号’!!!"
)
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