Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_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
b34f2c98
authored
Sep 18, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
75cd0dad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
func.py
func.py
View file @
b34f2c98
def
new_input
():
def
new_input
():
total
=
[]
total
=
[]
while
True
:
while
True
:
try
:
unit
=
input
(
"请输入:"
)
unit
=
int
(
input
(
"请输入:"
))
if
unit
==
'q'
:
except
:
break
else
:
if
unit
==
"q"
:
break
break
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
unit
)
return
(
total
)
print
(
total
)
def
sum
(
a
):
return
total
def
sum
(
total
):
count
=
0
count
=
0
for
i
in
a
:
for
i
in
total
:
count
=
count
+
i
count
=
count
+
int
(
i
)
new_input
()
print
(
count
)
#sum(new_input())
return
count
\ No newline at end of file
sum
(
new_input
())
\ 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