Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
e8862de7
authored
Sep 25, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c2dcc87d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
26 deletions
1.py
diy.py
1.py
0 → 100644
View file @
e8862de7
import
time
diy.py
View file @
e8862de7
class
hero
:
file
=
open
(
r"C:\Users\Administrator\Desktop\江思pig.txt"
,
"w"
,
encoding
=
'utf-8'
)
def
__init__
(
self
,
name
,
hp
,
attack
,
level
):
file
.
write
(
'江思pig你个大头鬼深金冰'
)
self
.
attack
=
attack
file
.
close
()
self
.
hp
=
hp
with
open
(
r"C:\Users\Administrator\Desktop\江思pig.txt"
,
"r"
,
encoding
=
'utf-8'
)
as
file
:
self
.
level
=
level
a
=
file
.
read
()
self
.
name
=
name
for
data
in
file
:
if
'江思pig你个大头鬼深金冰'
in
data
:
def
uplevel
(
self
):
print
(
"in it"
)
self
.
level
=
self
.
level
+
1
data
=
data
.
replace
(
'江思pig你个大头鬼深金冰'
)
self
.
hp
=
self
.
hp
+
50
new
+=
date
self
.
attack
=
self
.
attack
+
4
def
printdata
(
self
):
print
(
self
.
name
,
"level="
,
self
.
level
)
print
(
self
.
name
,
"attack="
,
self
.
attack
)
print
(
self
.
name
,
"hp="
,
self
.
hp
)
yase
=
hero
(
"yase"
,
300
,
21
,
1
)
houyi
=
hero
(
"houyi"
,
240
,
24
,
1
)
yase
.
uplevel
()
houyi
.
uplevel
()
yase
.
printdata
()
houyi
.
printdata
()
\ 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