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
08fbc133
authored
Apr 15, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
5ed2ace3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletions
1.py
func.py
1.py
0 → 100644
View file @
08fbc133
def
NEW_PRINCE
():
total
=
[]
while
True
:
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
:
break
else
:
try
:
unit
=
int
(
unit
)
except
:
print
(
'请重新输入'
)
else
:
total
.
append
(
unit
)
finally
:
print
(
"-"
*
30
)
print
(
total
)
return
total
def
x_1
(
money
):
y
=
0
for
i
in
money
:
y
=
y
+
i
print
(
y
)
return
y
price
=
NEW_PRINCE
()
pay
=
x_1
(
price
)
print
(
'您一共消费了'
+
str
(
pay
)
+
'元!扫码还是现金呢'
)
func.py
View file @
08fbc133
...
@@ -12,4 +12,12 @@ def NEW_PRINCE():
...
@@ -12,4 +12,12 @@ def NEW_PRINCE():
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
unit
)
return
total
return
total
NEW_PRINCE
()
def
x
(
money
):
y
=
0
for
i
in
money
:
y
=
y
+
i
print
(
y
)
return
y
price
=
NEW_PRINCE
()
pay
=
x
(
price
)
print
(
'您一共消费了'
+
str
(
pay
)
+
'元!扫码还是现金呢'
)
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