Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13_2
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
e11daca3
authored
Jul 18, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e102578b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
1.py
2.txt
diy.py
1.py
0 → 100644
View file @
e11daca3
# _+___+__+___+_
# \\ 王者荣耀 //
# --[=========]--
class
Hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
#属性名 属性值
self
.
level
=
1
#英雄等级
self
.
name
=
name
#英雄姓名
self
.
hp
=
hp
#英雄血量
self
.
attack
=
attack
#英雄攻击力
def
upgrade
():
yase
.
level
=
yase
.
level
+
1
yase
.
hp
=
yase
.
hp
+
50
yase
.
attack
=
yase
.
attack
+
10
yase
=
Hero
(
'亚瑟'
,
500
,
35
)
houyi
=
Hero
(
'后羿'
,
350
,
50
)
BLSY
=
Hero
(
'百里守约'
,
360
,
60
)
CVJ
=
Hero
(
'蔡文姬'
,
500
,
20
)
lan
=
Hero
(
'澜'
,
250
,
70
)
print
(
'亚瑟的生命值为'
,
yase
.
hp
)
print
(
'后羿的生命值为'
,
houyi
.
hp
)
print
(
'百里守约的生命值为'
,
BLSY
.
hp
)
print
(
'蔡文姬的生命值为'
,
CVJ
.
hp
)
print
(
'澜的生命值为'
,
lan
.
hp
)
2.txt
0 → 100644
View file @
e11daca3
悟空348诺依380小贝182李丽201宋扬107王明245李强164孙小白222苏琪137刘若若147刘阳226王胜男123王娇131
\ No newline at end of file
diy.py
View file @
e11daca3
...
...
@@ -5,7 +5,7 @@ with open (r'c:\Users\邢睿喆\Documents\lesson13-1\sales_list.txt','r',encodin
# data=i.split()
# print(data[0])
# print(data[1:])
final
=
[]
for
i
in
a
:
data
=
i
.
split
()
sum
=
0
...
...
@@ -14,5 +14,5 @@ for i in a:
result
=
data
[
0
]
+
str
(
sum
)
print
(
result
)
final
.
append
(
result
)
with
open
(
r'c:\Users\邢睿喆\Documents\lesson13-1\sales_list.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
a
=
file
.
readlines
()
\ No newline at end of file
with
open
(
r'c:\Users\邢睿喆\Documents\lesson13_2\2.txt'
,
'w'
,
encoding
=
'utf-8'
)
'
\n
'
as
file
:
file
.
writelines
(
final
)
\ 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