Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_1
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
7ef11c27
authored
Apr 30, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
9c5b877f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
store.py
store.py
View file @
7ef11c27
score
=
{
'语文'
:
91
,
'数学'
:
89
,
'英语'
:
85
}
s
=
input
(
'请输入您想查询的科目成绩:'
)
if
s
in
score
:
print
(
'*'
*
30
)
#for k,v in score.items():
#print(k,v)
print
(
score
[
s
])
print
(
'*'
*
30
)
\ No newline at end of file
stu1
=
{
'语文'
:
91
,
'数学'
:
89
,
'英语'
:
85
}
stu2
=
{
'语文'
:
89
,
'数学'
:
100
,
'英语'
:
80
}
stu3
=
{
'语文'
:
100
,
'数学'
:
90
,
'英语'
:
95
}
score
=
{
'悟空'
:
stu1
,
'诺依'
:
stu2
,
'小贝'
:
stu3
}
while
True
:
s
=
input
(
'请输入您的名字(如需退出请输入"退出"):'
)
if
s
in
score
:
info
=
score
[
s
];
print
(
'*'
*
30
)
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
#print(score[s])
print
(
'*'
*
30
)
elif
s
not
in
score
:
print
(
'*'
*
30
)
print
(
'此人不存在'
)
print
(
'*'
*
30
)
elif
s
==
'退出'
:
break
\ 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