Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
b147fad6
authored
Nov 30, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d493d152
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
diy2.py
iio.py
y.py
diy2.py
View file @
b147fad6
class
Hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
class
jj
:
def
__init__
(
self
,
name
,
foot
,
skin
):
self
.
level
=
1
self
.
name
=
name
self
.
hp
=
hp
self
.
attack
=
attack
yase
=
Hero
(
'yase'
,
300
,
20
)
hy
=
Hero
(
'hy'
,
250
,
23
)
k
=
Hero
(
'K'
,
5600
,
199
)
print
(
yase
.
attack
)
print
(
hy
.
attack
)
print
(
k
.
attack
)
\ No newline at end of file
self
.
foot
=
foot
self
.
skin
=
skin
yuh
=
jj
(
2
,
4
,
"black"
)
print
(
yuh
.
name
)
\ No newline at end of file
iio.py
0 → 100644
View file @
b147fad6
class
Hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
level
=
1
self
.
name
=
name
self
.
hp
=
hp
self
.
attack
=
attack
gy
=
Hero
(
'gy'
,
300
,
20
)
lb
=
Hero
(
'lb'
,
250
,
230
)
wk
=
Hero
(
'wk'
,
5600
,
199
)
print
(
gy
.
attack
)
print
(
ld
.
attack
)
print
(
wk
.
attack
)
\ No newline at end of file
y.py
0 → 100644
View file @
b147fad6
i1
=
{
"数学"
:
99
,
"语文"
:
67
,
"英语"
:
100
}
i2
=
{
"数学"
:
89
,
"语文"
:
89
,
"英语"
:
92
}
i3
=
{
"数学"
:
100
,
"语文"
:
97
,
"英语"
:
98
}
h
=
{
"小明"
:
i1
,
"小红"
:
i2
,
"秀秀"
:
i3
}
name
=
input
(
"你的名字"
)
if
name
in
h
:
print
(
"你的成绩是"
+
str
(
h
[
name
]))
else
:
print
(
"名字不在"
)
\ 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