Commit bf0a2d9f by BellCodeEditor

save project

parent e7df4dd7
Showing with 30 additions and 0 deletions
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()
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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment