0
このコードは、エラーを生成します:は何を引き起こしている「はTypeError:書式設定文字列中に変換されていないすべての引数」
# -*- coding: utf-8 -*-
amount = float(input("Enter the purchase price please."))
down_payment=amount *0.10
monthly_rate = (amount - down_payment) *.05
ending_balance=amount-down_payment
print("|Ø-6s|Ø-16s|Ø-9s|Ø-8s|Ø-14s|" % ("Month" , "Current Balance" , "Interest" , "Payment" , "Ending Balance"))
month = 1
while True:
starting_balance = ending_balance
interest = starting_balance * 0.01
final_amount = (starting_balance+interest)
if monthly_rate > final_amount:
monthly_rate = final_amount
ending_balance = final_amount - monthly_rate
print("|Ø-6f|Ø-16f|Ø-9f|Ø-8f|Ø-14f|" % (month , starting_balance , interest , monthly_rate , ending_balance))
month+=1
if ending_balance <= 0:
break
エラー:あなたの整形に代わりØ
の%
を使用する必要が
<module>
print("|Ø-6s|Ø-16s|Ø-9s|Ø-8s|Ø-14s|" % ("Month" , "Current Balance" , "Interest" , "Payment" , "Ending Balance"))
TypeError: not all arguments converted during string formatting
あなたはあなたの値のいずれかのための書式設定の指示を提供していないので、値のどれもがすべての上に残され、それらを残して、使用されていません。 – kindall