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
79888985
authored
Oct 04, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
64f46ca9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
4 deletions
diy2-test.py
jhugtu.py
qqhzz.py
diy2-test.py
View file @
79888985
class
Dog
:
# 狗类
=
"black"
coco
=
Husky
()
class
Dog
:
# 狗类
def
__init__
(
self
):
def
__init__
(
self
):
self
.
footNum
=
4
# 腿
self
.
footNum
=
4
# 腿
self
.
eyeNum
=
2
# 眼睛
self
.
eyeNum
=
2
# 眼睛
...
@@ -13,7 +15,5 @@ class Dog: # 狗类
...
@@ -13,7 +15,5 @@ class Dog: # 狗类
class
Husky
(
Dog
):
# 哈士奇类
class
Husky
(
Dog
):
# 哈士奇类
def
__init__
(
self
):
def
__init__
(
self
):
super
()
.
__init__
()
super
()
.
__init__
()
self
.
skin
=
"black"
self
.
skin
coco
=
Husky
()
print
(
coco
.
skin
)
print
(
coco
.
skin
)
\ No newline at end of file
jhugtu.py
0 → 100644
View file @
79888985
class
cat
():
def
__init__
(
self
):
super
()
.
__init__
()
self
.
skin
coco
=
Husky
()
# 曹嘉狗类
def
__init__
(
self
):
self
.
footNum
=
8
# 曹腿
self
.
eyeNum
=
9
# 曹眼睛
self
.
head
=
3
# 曹头
self
.
earsNum
=
6
# 曹耳朵
self
.
skin
=
"red"
def
run
(
self
):
print
(
"狗狗飞快的跑起来"
)
print
(
coco
)
\ No newline at end of file
qqhzz.py
0 → 100644
View file @
79888985
import
random
wu
=
[
"武装直升机"
,
"防空导弹"
,
"坦克"
,
"战略核武器"
,
"高超音速导弹"
,
"特种部队"
,
"主战坦克连"
]
w
=
[
"武装直升机"
,
"防空导弹"
,
"坦克"
]
player
=
input
(
"普通武器:武装直升机/防空导弹/坦克 超级武器:战略核武器/高超音速导弹/特种部队/主战坦克连,您派出:"
)
print
(
"............"
)
print
(
"红方派出"
+
player
)
yyl
=
random
.
choice
(
w
)
print
(
"蓝方派出"
+
yyl
)
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