Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_3
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
3f480308
authored
Oct 29, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ea38d86c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
diy3.py
diy3.py
View file @
3f480308
student1
=
{
'语文'
:
129
,
'数学'
:
146
,
'英语'
:
148
,
'总分'
:
423
}
student2
=
{
'语文'
:
93
,
'数学'
:
118
,
'英语'
:
149
,
'总分'
:
360
}
student3
=
{
'语文'
:
145
,
'数学'
:
115
,
'英语'
:
134
,
'总分'
:
394
}
student1
=
{
'语文'
:
222
,
'数学'
:
230
,
'英语'
:
250
,
'总分'
:
702
}
student2
=
{
'语文'
:
2
,
'数学'
:
1
,
'英语'
:
500
,
'总分'
:
503
}
student3
=
{
'语文'
:
229
,
'数学'
:
234
,
'英语'
:
250
,
'总分'
:
713
}
score
=
{
'沙安航'
:
student1
,
'王中博'
:
student2
,
'张天佑'
:
student3
}
...
...
@@ -8,12 +8,20 @@ score = {'沙安航': student1, '王中博': student2, '张天佑': student3}
# 查询并打印出输入的名字对应的所有科目的成绩
while
True
:
name
=
input
(
"名字:"
)
print
(
"请输入大才子的大名,退出q"
)
name
=
input
(
"姓名:"
)
print
(
"*"
*
30
)
if
name
in
score
:
a
=
score
[
name
]
print
(
'*'
*
30
)
for
k
,
v
in
a
.
items
():
info
=
score
[
name
]
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
print
(
'*'
*
30
)
elif
name
==
"q"
:
break
else
:
print
(
'输入错误'
)
\ No newline at end of file
print
(
"错误,重新输入"
)
print
(
'*'
*
30
)
print
(
"程序结束"
)
\ 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