python代码没有反应_Python代码不执行。没有显示错误

我不知道我的密码有什么问题。它不会被执行。什么都没有发生,也没有错误发生。我想不通。

如果有人能告诉我我做错了什么,请告诉我,我会很感激的。在class Money (object):

def __init__ (self, euro, cent):

self.euro = euro

self.cent = cent

def __str__ (self):

if self.cent >= 100:

r = self.cent / 100

self.cent = self.cent % 100

self.euro = self.euro + r

return ("%d EUR & %d cents") % (self.euro, self.cent)

else:

return ("%d EUR & %d cents") % (self.euro, self.cent)

def changeCent (self):

#100 c = 1 E

cents = self.euro * 100

self.cent = self.cent + cents

return self.cent

def changeSum (self, euros):

#1 E = 100 c

euros = self.cent / 100

self.euro = self.euro + euros

return self.euro

def debt (self, years, rate):

value = Money()

multiply = rate * years * 12 / 100

value.euro = self.euro * multiply

value.cent = self.cent * multiply

if value.cent > 100:

euro_ = value.cent / 100

value.cent = value.cent - 100

value.euro = value.euro + euro_

return value

def main():

x = Money()

x.euro = int(input("Type in your EURO ammount: \n"))

x.cent = int(input("Type in your CENT ammount: \n"))

print (x)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值