Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-2
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
57f06cd7
authored
Oct 30, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
281c798c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
qo.py
qo.py
View file @
57f06cd7
def
s
():
def
s
():
a
=
[]
a
=
[]
while
True
:
while
True
:
money
=
input
(
"请输入(z退出):"
)
n
=
input
(
"请输入(z退出):"
)
if
money
==
"z"
:
if
n
==
"z"
:
break
break
else
:
else
:
try
:
try
:
money
=
int
(
money
)
n
=
int
(
n
)
except
:
except
:
print
(
"请重新输入:"
)
print
(
"请重新输入:"
)
else
:
else
:
a
.
append
(
money
)
a
.
append
(
n
)
print
(
"="
*
100
)
print
(
"="
*
100
)
return
a
return
a
def
sum
(
money
):
c
=
0
for
i
in
money
:
c
=
c
+
i
return
c
x
=
s
()
x
=
s
()
print
(
x
)
p
=
sum
(
x
)
\ No newline at end of file
print
(
"你一共消费了"
+
str
(
p
)
+
"元!!!请付账!!!!!"
)
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