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
fa3c5fe9
authored
Mar 05, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
bd23a190
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
__pycache__/func.cpython-37.pyc
func.py
swim.py
__pycache__/func.cpython-37.pyc
0 → 100644
View file @
fa3c5fe9
File added
func.py
View file @
fa3c5fe9
...
@@ -2,16 +2,28 @@ def func():
...
@@ -2,16 +2,28 @@ def func():
total
=
[]
total
=
[]
while
True
:
while
True
:
unit
=
input
(
"请输入:"
)
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
:
print
(
"结束"
)
break
try
:
try
:
unit1
=
int
(
unit
)
unit1
=
int
(
unit
)
except
:
except
:
if
unit
==
'q'
:
print
(
"结束"
)
break
print
(
"要输入整数,重新输入"
)
print
(
"要输入整数,重新输入"
)
continue
continue
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
unit1
)
print
(
total
)
return
total
r
=
func
()
def
count
(
alist
):
sum1
=
0
for
i
in
alist
:
sum1
=
sum1
+
i
return
sum1
n
=
count
(
r
)
print
(
n
)
func
()
\ No newline at end of file
swim.py
0 → 100644
View file @
fa3c5fe9
import
func
data
=
func
.
func
()
score
=
func
.
count
(
data
)
print
(
score
)
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