8000 Add rounding to Ch 6 challenge solution · monkeyfx/python-basics-exercises@34aaf92 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34aaf92

Browse files
committed
Add rounding to Ch 6 challenge solution
1 parent ce3f3bd commit 34aaf92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ch06-functions-and-loops/5-challenge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def invest(amount, rate, time):
1010
print("annual rate of return:", rate)
1111
for t in range(1, time + 1):
1212
amount = amount * (1 + rate)
13-
print(f"year {t}: ${amount}")
13+
print(f"year {t}: ${amount:,.2f}")
1414
print()
1515

1616

0 commit comments

Comments
 (0)
0