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
21783ef1
authored
Oct 27, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
303bd2db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
diy.py
h.py
diy.py
View file @
21783ef1
class
hero
:
class
hero
:
def
__init__
(
self
):
def
__init__
(
self
,
hp
,
attack
):
self
.
level
=
1
self
.
level
=
1
self
.
hp
=
300
self
.
hp
=
hp
self
.
attack
=
200
self
.
attack
=
attack
daji
=
hero
()
daji
=
hero
(
300
,
200
)
print
(
daji
.
attack
)
\ No newline at end of file
for
i
in
range
(
1
,
10
):
daji
.
level
=
i
daji
.
attack
=
daji
.
attack
+
100
daji
.
hp
=
daji
.
hp
+
50
print
(
daji
.
hp
)
\ No newline at end of file
h.py
0 → 100644
View file @
21783ef1
class
cake
:
def
__init__
(
self
,
size
,
cream
,
fruit
):
self
.
size1
=
size
self
.
cream1
=
cream
self
.
fruit1
=
fruit
birthday_cake1
=
cake
(
16
,
"plant_cream"
,
"apple"
)
birthday_cake2
=
cake
(
20
,
"pure_cream"
,
"chess"
)
print
(
birthday_cake1
.
size1
)
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