Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson12-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
f6ba2967
authored
Jul 07, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
7b29420e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
1 deletions
1.py
12345.py
sales_list.txt
成绩
1.py
View file @
f6ba2967
class
Hero
:
def
__init__
(
self
):
self
.
level
=
1
self
.
hp
=
100
self
.
attack
=
100
yase
=
Hero
()
\ No newline at end of file
12345.py
0 → 100644
View file @
f6ba2967
with
open
(
r"C:\Users\pc\Desktop\123\成绩.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
file
:
a
=
file
.
readlines
()
g
=
[]
for
i
in
a
:
c
=
i
.
split
()
sum
=
0
for
sales
in
c
[
1
:]:
sum
=
sum
+
int
(
sales
)
result
=
c
[
0
]
+
str
(
sum
)
+
'
\n
'
g
.
append
(
result
)
print
(
result
)
with
open
(
r"c:\Users\pc\Desktop\123\新建文本文档.txt"
,
"a"
,
encoding
=
"utf-8"
)
as
file
:
file
.
writelines
(
g
)
\ No newline at end of file
sales_list.txt
View file @
f6ba2967
with open()
\ No newline at end of file
成绩
View file @
f6ba2967
-- "a/\346\210\220\347\273\251"
with
with
\ 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