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
8783eb33
authored
Sep 20, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
edf8fb61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
27 deletions
a.py
b.py
a.py
View file @
8783eb33
def
a
():
def
new_input
():
total
=
[]
total
=
[]
while
True
:
while
True
:
unit
=
input
(
"请输入:"
)
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
:
if
unit
==
'q'
:
break
break
else
:
else
:
try
:
total
.
append
(
unit
)
total
.
append
(
unit
)
print
(
total
)
except
:
new_input
()
print
(
total
)
return
total
b
=
a
():
print
()
b.py
deleted
100644 → 0
View file @
edf8fb61
scores
=
{
'语文'
:
89
,
'数学'
:
95
,
'英语'
:
80
}
def
get_average
(
scores
):
score
=
0
for
subject
,
scoe
print
(
'现在的总分是
%
d'
%
score
)
ave_score
=
score
/
len
(
scores
)
re
in
scores
.
items
():
score
+=
scor
print
(
'平均分是
%
d'
%
ave_score
)
get_average
(
scores
)
\ 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