Skip to content

Commit f63ef1f

Browse files
committed
Add docstring
1 parent 97bc285 commit f63ef1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ch06-functions-and-loops/5-challenge-track-your-investments.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
def invest(amount, rate, years):
9+
"""Display year on year growth of an initial investment"""
910
for year in range(1, years + 1):
1011
amount = amount * (1 + rate)
1112
print(f"year {year}: ${amount:,.2f}")

0 commit comments

Comments
 (0)