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
006e394a
authored
Jul 15, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
3249ef80
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
4 deletions
66.py
__pycache__/func.cpython-37.pyc
func.py
swim.py
66.py
0 → 100644
View file @
006e394a
# file1=open(r"C:\Users\Administrator\Desktop\test.txt","w",encoding='utf-8')
# file1.write('小兰:12本')
# file1.close()
# file1=open(r"C:\Users\Administrator\Desktop\test.txt","w",encoding='utf-8')
# file1.write('老马:12本\n')
# file1.write('小强:10本\n')
# file1.close()
# file1=open(r"C:\Users\Administrator\Desktop\test.txt","a",encoding='utf-8')
# file1.write('小兰:12本')
# file1.close()
with
open
(
r"C:\Users\Administrator\Desktop\test.txt"
,
"a"
,
encoding
=
'utf-8'
)
as
file
:
file
.
write
(
'小兰:12本'
)
\ No newline at end of file
__pycache__/func.cpython-37.pyc
0 → 100644
View file @
006e394a
File added
func.py
View file @
006e394a
def
daima
():
def
new_input
():
total
=
[]
total
=
[]
while
True
:
while
True
:
unit
=
input
(
"请输入:"
)
unit
=
input
(
"请输入:"
)
...
@@ -13,5 +13,12 @@ def daima():
...
@@ -13,5 +13,12 @@ def daima():
total
.
append
(
unit
)
total
.
append
(
unit
)
finally
:
finally
:
print
(
'-'
*
30
)
print
(
'-'
*
30
)
print
(
total
)
return
total
daima
()
def
sum
(
money
):
\ No newline at end of file
count
=
0
for
i
in
money
:
count
=
count
+
i
return
count
# price=new_input()
# pay=sum(price)
# print('您消费'+str(pay)+'元,扫码还是现金')
\ No newline at end of file
swim.py
0 → 100644
View file @
006e394a
import
func
data
=
func
.
new_input
()
score
=
func
.
sum
(
data
)
print
(
'总分为'
+
str
(
score
)
+
'分'
)
\ 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