Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_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
5a095f29
authored
Jul 21, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2f99873a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
12 deletions
diw.py
diy1.py
func.py
diw.py
View file @
5a095f29
def
ji
():
def
ji
():
total
=
total
=
[]
\ No newline at end of file
while
True
:
a
=
input
(
'请输入'
)
if
a
==
'q'
break
else
:
diy1.py
View file @
5a095f29
...
@@ -11,9 +11,9 @@ def ji():
...
@@ -11,9 +11,9 @@ def ji():
print
(
'重新输入'
)
print
(
'重新输入'
)
else
:
else
:
total
.
append
(
a
)
total
.
append
(
a
)
return
total
print
(
total
)
b
=
ji
()
ji
()
print
(
b
)
...
...
func.py
View file @
5a095f29
total
=
[]
def
ji
():
while
True
:
total
=
[]
unit
=
input
(
"请输入:"
)
while
True
:
if
unit
==
'q'
:
a
=
input
(
'请输入'
)
if
a
==
'q'
:
break
break
else
:
else
:
total
.
append
(
unit
)
try
:
print
(
total
)
a
=
int
(
a
)
\ No newline at end of file
except
:
print
(
'重新输入'
)
else
:
total
.
append
(
a
)
return
total
def
sum
(
money
):
cont
=
0
for
i
in
money
:
cont
=
cont
+
i
return
cont
c
=
ji
()
d
=
sum
(
c
)
print
(
'总共花了'
+
str
(
d
)
+
'元'
)
\ 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