我相信我设置的程序是对的,但它在第10行出错了。但是,当我在Powershell中单独运行该部分时,它不会出错。提前谢谢你的帮助。在
def hotel_cost(nights):
return nights * 140
bill = hotel_cost(5)
balance = int(raw_input("What's the balance?"))
rate = float(raw_input("What's the interest rate? i.e. .02 = 2%")
def get_min(balance,rate):
return balance*rate
#line 10 is above
print get_min(balance,rate)
def add_monthly_interest(balance):
return balance*((rate/12)+1)
我要做的是编写一个函数,其中包含add_monthly_interest,它将返回信用卡的余额,并将利息添加到信用卡上。例如100*((.15/12)+1)=101.25
缺少右括号。在
相关问题 更多 >
编程相关推荐