Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_3
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
c5692a07
authored
Aug 16, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
77b7c9c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
func.py
func.py
View file @
c5692a07
def
a
():
def
a
():
total
=
[]
total
=
0
total1
=
[]
while
True
:
while
True
:
unit
=
input
(
"请输入单价:"
)
unit
=
input
(
"请输入单价:"
)
if
unit
==
'q'
:
if
unit
==
'q'
:
print
(
'现在总计为:'
+
str
(
total
))
return
unit
break
break
else
:
else
:
try
:
try
:
...
@@ -12,12 +11,17 @@ def a():
...
@@ -12,12 +11,17 @@ def a():
except
:
except
:
print
(
'请输入整数!'
)
print
(
'请输入整数!'
)
else
:
else
:
total
.
append
(
int
(
unit
))
total
+=
unit
total1
.
append
(
int
(
unit
))
print
(
'现在总计为:'
+
str
(
total
))
print
(
'现在总计为:'
+
str
(
total
))
print
(
'各计单价为:'
+
str
(
total1
))
finally
:
finally
:
print
(
'-'
*
30
)
print
(
'-'
*
30
)
print
(
'总计为:'
+
str
(
total
))
print
(
'各计单价为:'
+
str
(
total1
))
print
(
'-'
*
30
)
return
total
while
True
:
while
True
:
a
()
a
()
...
...
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