Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_4
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
26fd95f5
authored
Jun 25, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4c11decd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
1 deletions
diy1.py
hwh.py
test.py
diy1.py
View file @
26fd95f5
...
@@ -46,7 +46,7 @@ class Player(Hero):
...
@@ -46,7 +46,7 @@ class Player(Hero):
houyi
=
Player
(
"射手"
,
"后羿"
)
houyi
=
Player
(
"射手"
,
"后羿"
)
yase
=
Hero
(
"
垭
瑟"
)
yase
=
Hero
(
"
亚
瑟"
)
# yase.combat(houyi)
# yase.combat(houyi)
# houyi.cure()
# houyi.cure()
...
...
hwh.py
0 → 100644
View file @
26fd95f5
# class Stubit:
# def __init__(self,name,age,score):
# self.name = name
# self.age = age
# self.score = score
# def get_name(self):
# return self.name
# def get_age(self):
# return self.age
# def get_score(self):
# return max(self.score)
# stubit = Stubit("潘伞兵",8,[10,22,5])
# print(stubit.get_name())
# print(stubit.get_age())
# print(stubit.get_score())
class
C
:
def
__init__
(
self
,
m
,
mo
):
self
.
m
=
m
self
.
mo
=
mo
def
output_c
(
self
):
return
"制造商"
+
self
.
m
+
",型号"
+
self
.
mo
class
Ec
(
C
):
def
__init__
(
self
,
m
,
mo
,
bs
):
super
()
.
__init__
(
m
,
mo
)
self
.
bs
=
bs
def
output_b
(
self
):
return
"这辆汽车还有"
+
str
(
self
.
bs
)
+
"千瓦时电量"
mc
=
Ec
(
"比亚迪"
,
"汉-超跑版"
,
60
)
print
(
mc
.
output_c
())
print
(
mc
.
output_b
())
\ No newline at end of file
test.py
0 → 100644
View file @
26fd95f5
from
random
import
*
sqstr
=
0
# print("答对了")
while
sqstr
<
100
:
sbstr
=
randint
(
10
,
99
)
sdstr
=
randint
(
10
,
99
)
sxstr
=
input
(
str
(
sbstr
)
+
"+"
+
str
(
sdstr
)
+
"="
)
try
:
dsbstr
=
sbstr
+
sdstr
dsxstr
=
int
(
sxstr
)
# if dsxstr==dsbstr:
# sqstr+=10
# print("答对了")
except
:
print
(
"sb"
)
else
:
if
dsxstr
==
dsbstr
:
sqstr
+=
10
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