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
a9a2c5c6
authored
Jan 01, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
86f77f2d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
diy.py
sales_list.txt
diy.py
View file @
a9a2c5c6
with
open
(
r'c:\Users\张琰\Desktop\
新建文本文档
.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
with
open
(
r'c:\Users\张琰\Desktop\
sales_list.txt
.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
a
=
file
.
readlines
()
for
i
in
a
:
b
=
i
.
split
()
print
(
b
[
1
])
\ No newline at end of file
#print(b[1])
sum
=
0
for
sales
in
b
[
1
:]:
sum
=
sum
+
int
(
sales
)
c
=
b
[
0
]
+
str
(
sum
)
print
(
c
)
\ No newline at end of file
sales_list.txt
View file @
a9a2c5c6
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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