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
d28b6cf2
authored
Jul 03, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
63eb0d0b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
.py
diy.py
now_sales_list.txt
.py
0 → 100644
View file @
d28b6cf2
class
Hero
:
def
__init__
(
self
):
self
.
level
=
1
self
.
hp
=
300
self
.
attack
=
20
yase
=
Hero
()
print
(
"垭瑟的血量为:"
,
yase
.
hp
)
print
(
"垭瑟的攻击力为:"
,
yase
.
attack
)
\ No newline at end of file
diy.py
View file @
d28b6cf2
...
@@ -9,4 +9,4 @@ with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',enco
...
@@ -9,4 +9,4 @@ with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',enco
result
=
data
[
0
]
+
str
(
sum
)
+
'
\n
'
#data[0]名字,str(sum) 数字总和
result
=
data
[
0
]
+
str
(
sum
)
+
'
\n
'
#data[0]名字,str(sum) 数字总和
final_sum
.
append
(
result
)
final_sum
.
append
(
result
)
with
open
(
r'C:\Users\Administrator\Documents\lesson13-1\now_sales_list.txt'
,
'a'
,
encoding
=
'utf-8'
)
as
file
:
with
open
(
r'C:\Users\Administrator\Documents\lesson13-1\now_sales_list.txt'
,
'a'
,
encoding
=
'utf-8'
)
as
file
:
file
.
writelines
(
final_sum
)
file
.
writelines
(
final_sum
)
``````
\ No newline at end of file
\ No newline at end of file
now_sales_list.txt
View file @
d28b6cf2
悟空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悟空348
悟空348
诺依380
诺依380
小贝182
小贝182
李丽201
李丽201
...
...
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