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
6467cd40
authored
Jan 30, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
64566781
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
diy.py
lzx.txt
diy.py
View file @
6467cd40
...
...
@@ -2,10 +2,15 @@ with open(r'C:\Users\EDZ\Documents\lesson13-1\sales_list.txt' ,'r',encoding='utf
a
=
file
.
readlines
()
# print(a)
sum
=
0
list
=
[]
for
i
in
a
:
num
=
i
.
split
()
# print(num[1:])
for
mk
in
num
[
1
:]:
sum
=
sum
+
int
(
mk
)
result
=
num
[
0
]
+
str
(
sum
)
print
(
result
)
\ No newline at end of file
result
=
num
[
0
]
+
str
(
sum
)
+
"
\n
"
# print(result)
list
.
append
(
result
)
print
(
list
)
with
open
(
r'C:\Users\EDZ\Documents\lesson13-1\lzx.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
file
:
file
.
writelines
(
list
)
lzx.txt
0 → 100644
View file @
6467cd40
悟空348
诺依728
小贝910
李丽1111
宋扬1218
王明1463
李强1627
孙小白1849
苏琪1986
刘若若2133
刘阳2359
王胜男2482
王娇2613
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