Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_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
f8d88f30
authored
Jul 06, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
024fb164
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
__pycache__/func.cpython-37.pyc
func.py
tongji.py
__pycache__/func.cpython-37.pyc
0 → 100644
View file @
f8d88f30
File added
func.py
View file @
f8d88f30
total
=
[]
def
func
():
while
True
:
total
=
[]
unit
=
input
(
"请输入:"
)
while
True
:
if
unit
==
'q'
:
try
:
#尝试运行
break
unit
=
int
(
input
(
"请输入:"
))
else
:
except
:
#如果输入的不是整数,则执行except下面的语句
total
.
append
(
unit
)
print
(
"请输入整数"
)
print
(
total
)
else
:
#如果输入的数据符合要求,则执行else下面的语句
\ No newline at end of file
if
unit
==
0
:
break
else
:
total
.
append
(
unit
)
print
(
total
)
return
total
def
jisuan
(
total
):
count
=
0
for
i
in
total
:
count
=
count
+
i
return
count
# abc = func()
# jiage = jisuan(abc)
# print(jiage)
\ No newline at end of file
tongji.py
0 → 100644
View file @
f8d88f30
import
func
data
=
func
.
func
()
zf
=
func
.
jisuan
(
data
)
print
(
"总分是:"
,
zf
)
\ 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