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
ede4e4c4
authored
Oct 17, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e3ce839f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
diy.py
sales_list.txt
diy.py
View file @
ede4e4c4
...
@@ -5,5 +5,7 @@ with open (r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',enc
...
@@ -5,5 +5,7 @@ with open (r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',enc
sum
=
0
sum
=
0
for
sales
in
data
[
1
:]:
for
sales
in
data
[
1
:]:
sum
=
sum
+
int
(
sales
)
sum
=
sum
+
int
(
sales
)
result
=
data
[
0
]
+
str
(
sum
)
result
=
data
[
0
]
+
str
(
sum
)
+
'
\n
'
print
(
result
)
with
open
(
r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
file1
:
\ No newline at end of file
file1
.
writelines
(
result
)
sales_list.txt
View file @
ede4e4c4
悟空 12 12 11
诺伊320
诺伊 45 67 37
小贝 23 34 56
\ 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