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
b76596e7
authored
Mar 02, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c4a4b0a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
25 deletions
func.py
swim.py
func.py
View file @
b76596e7
def
eat
():
# def eat():
total
=
[]
# total = []
while
True
:
# while True:
unit
=
input
(
"请输入(按q退出):"
)
# unit = input("请输入(按q退出):")
if
unit
==
'q'
:
# if unit== 'q':
break
# break
else
:
# else:
try
:
# try:
unit
=
int
(
unit
)
# unit = int(unit)
except
:
# except:
print
(
"请输入整数"
)
# print("请输入整数")
else
:
# else:
total
.
append
(
unit
)
# total.append(unit)
finally
:
# finally:
print
(
"-"
*
30
)
# print("-"*30)
return
total
# return total
def
sum
(
money
):
# def sum(money):
s
=
0
# s = 0
for
i
in
money
:
# for i in money:
s
+=
i
# s += i
return
s
# return s
z
=
eat
()
# z = eat()
a
=
sum
(
z
)
# a = sum(z)
print
(
a
)
# print("您总共需要支付",a,"元,请问是现金还是手机支付?")
\ No newline at end of file
\ No newline at end of file
swim.py
0 → 100644
View file @
b76596e7
import
func
print
(
"哈哈"
)
\ 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