Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-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
eb514b72
authored
Jul 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
5a7a300b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
diy.py
new_sales_list.txt
sss.py
diy.py
View file @
eb514b72
with
open
(
r"c:\Users\15731\Documents\lesson13-4\sales_list.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
file1
:
with
open
(
r"c:\Users\15731\Documents\lesson13-4\sales_list.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
file1
:
a
=
file1
.
readlines
()
a
=
file1
.
readlines
()
final_sum
=
[]
for
i
in
a
:
for
i
in
a
:
data
=
i
.
split
()
data
=
i
.
split
()
sum
=
0
sum
=
0
for
b
in
data
[
1
:]:
for
b
in
data
[
1
:]:
sum
=
sum
+
int
(
b
)
sum
=
sum
+
int
(
b
)
new_data
=
data
[
0
]
+
str
(
sum
)
new_data
=
data
[
0
]
+
str
(
sum
)
print
(
new_data
)
final_sum
.
append
(
new_data
)
\ No newline at end of file
print
(
new_data
)
with
open
(
r"c:\Users\15731\Documents\lesson13-4\new_sales_list.txt"
,
"a"
,
encoding
=
"utf-8"
)
as
file1
:
file1
.
writelines
(
final_sum
)
\ No newline at end of file
new_sales_list.txt
0 → 100644
View file @
eb514b72
悟空348诺依380小贝182李丽201宋扬107王明245李强164孙小白222苏琪137刘若若147刘阳226王胜男123王娇131悟空348诺依380小贝182李丽201宋扬107王明245李强164孙小白222苏琪137刘若若147刘阳226王胜男123王娇131
\ No newline at end of file
sss.py
0 → 100644
View file @
eb514b72
with
open
(
r"c:\Users\15731\Documents\lesson13-4\sales_list.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
file1
:
a
=
file
.
readlines
()
final_sum
=
[]
\ 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