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
bf0a2d9f
authored
Jun 25, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e7df4dd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
sbstr.py
sdstr.py
sbstr.py
0 → 100644
View file @
bf0a2d9f
class
Car
:
def
__init__
(
self
,
make
,
model
):
self
.
make
=
make
self
.
model
=
model
def
output_car
(
self
):
print
(
"这辆车是"
,
self
.
make
,
"的"
,
self
.
model
)
class
dCar
(
Car
):
def
__init__
(
self
,
make
,
model
,
bs
):
super
()
.
__init__
(
make
,
model
)
self
.
bs
=
bs
def
opbs
(
self
):
print
(
"这辆汽车还有"
,
self
.
bs
,
"千瓦时的电量"
)
sb
=
dCar
(
"比亚迪"
,
"秦"
,
47648473654876
)
sb
.
opbs
()
sb
.
output_car
()
sdstr.py
0 → 100644
View file @
bf0a2d9f
class
sdstr
:
def
__init__
(
self
,
money
,
rate
,
n
):
self
.
money
=
money
self
.
rate
=
rate
self
.
n
=
n
def
pay
(
self
):
sbstr
=
self
.
rate
/
1200
sqstr
=
1
-
(
1
+
sbstr
)
**
(
-
12
*
self
.
n
)
sxstr
=
sbstr
/
sqstr
*
self
.
money
print
(
format
(
sxstr
,
'.2f'
))
dsbstr
=
sdstr
(
500000
,
5.6
,
20
)
dsbstr
.
pay
()
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