Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-3
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
4d4a8f2e
authored
Aug 06, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
f8981280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
dhggdf.py
jhkhj.py
dhggdf.py
View file @
4d4a8f2e
a
=
[
"你好呀
\n
"
,
"悟空
\n
"
,
"我在贝尔学编程
\n
"
]
with
open
(
"hello.txt"
,
"w"
,
encoding
=
"utf-8"
)
as
filel
:
filel
.
writelines
(
a
)
\ No newline at end of file
num_sum
=
[]
with
open
(
r"C:\Users\Administrator"
,
"r"
,
encoding
=
"utf-8"
)
as
filel
:
text
=
filel
.
readlines
()
print
(
text
)
for
txt
in
text
:
data
=
txt
.
split
()
total
=
data
[
1
:]
a
=
0
for
rum
in
total
:
a
+=
int
(
rum
)
filel
.
append
(
data
[
0
]
+
str
(
a
)
+
"/n"
)
print
(
num_sum
)
\ No newline at end of file
jhkhj.py
0 → 100644
View file @
4d4a8f2e
with
open
(
"hello.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
filel
:
a
=
filel
.
readlines
()
result_list
=
[]
for
i
in
a
:
data
=
i
.
split
()
name
=
data
[
0
]
number
=
data
[
1
:]
sum
=
0
for
money
in
number
:
sum
+=
int
(
money
)
\ 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