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
3182aeff
authored
Aug 04, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2a859e6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
.py
diy3.py
.py
View file @
3182aeff
import
import
time
print
(
"欢迎使用查询总分系统!"
)
time
.
sleep
(
1
)
a
=
input
(
"请输入您的总分:"
)
time
.
sleep
(
1
)
print
(
"查询中···"
)
time
.
sleep
(
3
)
print
(
"您的总分是"
+
a
+
"!"
)
\ No newline at end of file
diy3.py
View file @
3182aeff
...
...
@@ -5,7 +5,7 @@ score = {'悟空': student1, '诺依': student2, '小贝': student3}
# info=score['悟空']
# for k,v in info.items():
# print(k,v)
b
=
0
# 查询并打印出输入的名字对应的所有科目的成绩
while
True
:
...
...
@@ -18,8 +18,9 @@ while True :
a
=
score
[
name
]
print
(
'*'
*
30
)
for
k
,
v
in
a
.
items
():
b
+=
v
print
(
k
,
v
)
break
print
(
"您的总分是"
+
str
(
b
)
+
"分!"
)
else
:
print
(
'输入错误'
)
continue
\ 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