1---
2version: 0.1.0
3precision: 2
4form_title: Compound interest
5form_description: See how your savings grow. Switch to Form view (Pro) for a clean input mask.
6form_inputs: Principal|principal, Rate % p.a.|rate, Years|years, Compounding|comp[Yearly:1,Monthly:12]
7form_outputs: Final amount|final_amount, Interest earned|interest
8---
9# Compound interest — this notebook also has a FORM (Pro).
10# In the app, tap the form icon to turn it into an input mask.
11
12# Inputs (the form binds to these assignments):
13principal = 1000
14rate = 5
15years = 10
16comp = 1
17
18# Outputs (computed; shown read-only in the form):
19final_amount = principal * (1 + (rate / 100) / comp) ^ (comp * years)
20interest = final_amount - principal
21