Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3881dd

Browse files
committed
Modificação do exercicio 1_10
Utilização de f strings.
1 parent d66ca58 commit a3881dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Work/mortgage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
else:
2222
principal = principal * (1 + rate/12) - payment
2323
total_paid = total_paid + payment
24-
print(numero_meses_pagamento, round(total_paid, 2), round(principal, 2))
24+
print(f"{numero_meses_pagamento:10d} {total_paid:10.2f} {principal:10.2f}")
2525

26-
print("Total paid", round(total_paid, 2))
27-
print("Total de meses:", numero_meses_pagamento)
26+
print(f"Total pago: {total_paid:10.2f}")
27+
print(f"Total de meses: {numero_meses_pagamento:2d}")

0 commit comments

Comments
 (0)