Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-1
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
59fad77b
authored
Jun 16, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2d244e7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
diy.py
sales_list.txt
diy.py
View file @
59fad77b
with
open
(
r"c:\Users\Administrator\Documents\lesson13-1\sales_list.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
a
:
w
=
a
.
readlines
()
# print(w)
c
=
[]
for
i
in
w
:
s
=
i
.
split
()
d
=
s
[
1
:]
# print(d)
k
=
0
for
n
in
d
:
k
=
k
+
int
(
n
)
# print(n)
c
.
append
(
s
[
0
]
+
str
(
k
)
+
"
\n
"
)
with
open
(
r"c:\Users\Administrator\Documents\lesson13-1\sales_list.txt"
,
"a"
,
encoding
=
"utf-8"
)
as
a
:
a
.
writelines
(
c
)
\ No newline at end of file
sales_list.txt
View file @
59fad77b
李玉成 12 22 34 15 13 12 12 11
陈敬瑄 11 12 12 31 41
五号波 22 21 23
历史元 11 34 45 45
唐太宗 55 66 77 88李玉成131陈敬瑄107五号波66历史元135唐太宗286
\ 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