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
5ecfad31
authored
Jan 20, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c7d1186a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
__pycache__/func.cpython-37.pyc
func.py
qwer.py
__pycache__/func.cpython-37.pyc
0 → 100644
View file @
5ecfad31
File added
func.py
View file @
5ecfad31
def
menu
():
def
menu
():
total
=
[]
total
=
[]
while
True
:
while
True
:
unit
=
input
(
"请输入:"
)
money
=
input
(
"请输入:"
)
if
unit
==
'q'
:
if
money
==
'q'
:
break
break
else
:
else
:
try
:
try
:
unit
=
int
(
unit
)
money
=
int
(
money
)
except
:
except
:
print
(
'请输入一个整数'
)
print
(
'请输入一个整数'
)
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
money
)
finally
:
finally
:
print
(
'*'
*
50
)
print
(
'*'
*
50
)
return
total
return
total
print
(
menu
())
def
sum
(
price
):
\ No newline at end of file
a
=
0
for
i
in
price
:
a
=
a
+
i
return
a
#pay=sum
#print('你一共消费了'+str(pay)+'元!扫码或者现金支付')
\ No newline at end of file
qwer.py
0 → 100644
View file @
5ecfad31
import
func
a
=
func
.
menu
()
b
=
func
.
sum
(
a
)
print
(
'这位选手的总分是:'
+
str
(
b
))
\ 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