Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_test2
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
eb72e86d
authored
Jul 27, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
5aab51be
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
32 deletions
1.py
2.py
3.py
diy2-test.py
1.py
View file @
eb72e86d
h
=
float
(
input
(
"SB输入身高:"
))
w
=
float
(
input
(
"SB输入体重:"
))
bmi
=
w
/
(
h
*
h
)
if
bmi
>=
28
:
print
(
"肥胖"
)
elif
bmi
<=
18.4
:
print
(
"偏瘦"
)
elif
bmi
>=
18.5
and
bmi
<=
23.9
:
print
(
"正常"
)
elif
bmi
>=
24.0
and
bmi
<=
27.9
:
print
(
"过重"
)
name
=
input
(
"请输入你的姓名"
)
print
(
name
+
"你滚"
)
\ No newline at end of file
2.py
0 → 100644
View file @
eb72e86d
3.py
0 → 100644
View file @
eb72e86d
diy2-test.py
deleted
100644 → 0
View file @
5aab51be
class
Dog
:
# 狗类
def
__init__
(
self
):
self
.
footNum
=
4
# 腿
self
.
eyeNum
=
2
# 眼睛
self
.
head
=
1
# 头
self
.
earsNum
=
2
# 耳朵
self
.
skin
=
"white"
def
run
(
self
):
print
(
"狗狗飞快的跑起来"
)
class
Husky
(
Dog
):
# 哈士奇类
def
__init__
(
self
):
super
()
.
__init__
()
self
.
skin
=
'blue'
coco
=
Husky
()
print
(
coco
.
skin
)
\ 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