Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_4
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
cc6991da
authored
Jul 17, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
3f4dabeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
diy.p0y
diy.py
diy.p0y
0 → 100644
View file @
cc6991da
a=('z':91,'x':88,'c':85)
b=('z':97,'x':98,'c':90)
d=('z':95,'x':100,'c':93)
score=('悟空':a,'诺依':b,'小贝':d)
while True:
print('请输入要查询的名字,退出请输入q')
name=input('姓名')
print('*' * 30)
if name in score:
info=score[name]
for k,v in info.items():
print(k,v)
print('*' * 30)
elif name =='q':
break
else:
print('查询错误,请重新输入')
print("*"*30)
print('程序结束')
diy.py
0 → 100644
View file @
cc6991da
a
=
{
'z'
:
91
,
'x'
:
88
,
'c'
:
85
}
b
=
{
'z'
:
97
,
'x'
:
98
,
'c'
:
90
}
d
=
{
'z'
:
95
,
'x'
:
100
,
'c'
:
93
}
score
=
{
'悟空'
:
a
,
'诺依'
:
b
,
'小贝'
:
d
}
while
True
:
print
(
'请输入要查询的名字,退出请输入q'
)
name
=
input
(
'姓名'
)
print
(
'*'
*
30
)
if
name
in
score
:
info
=
score
[
name
]
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
print
(
'*'
*
30
)
elif
name
==
'q'
:
break
else
:
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