Skip to content

Commit cd2ee2e

Browse files
Update Compound Interest Calculator.py
1 parent 170ec86 commit cd2ee2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Compound Interest Calculator.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ def clear_all() :
66
compound_field.delete(0, END)
77
principle_field.focus_set()
88

9-
def calculate_ci():
9+
def calculate_compoundinterest():
1010
principle = int(principle_field.get())
1111
rate = float(rate_field.get())
1212
time = int(time_field.get())
13-
CI = principle * (pow((1 + rate / 100), time))
14-
compound_field.insert(10, CI)
13+
compoundinterest = principle * (pow((1 + rate / 100), time))
14+
compound_field.insert(10, compoundinterest)
1515

1616
if __name__ == "__main__" :
1717
root = Tk()
18-
root.geometry("400x250")
18+
root.geometry("310x250")
1919
root.title("Compound Interest Calculator")
2020
label1 = Label(root, text = "Principle Value",
2121
fg = 'black', bg = 'orange')
@@ -45,7 +45,7 @@ def calculate_ci():
4545
compound_field.grid(row = 5, column = 1, padx = 10, pady = 10)
4646

4747
button1 = Button(root, text = "Submit", bg = "orange",
48-
fg = "black", command = calculate_ci)
48+
fg = "black", command = calculate_compoundinterest)
4949
button2 = Button(root, text = "Clear", bg = "orange",
5050
fg = "black", command = clear_all)
5151

0 commit comments

Comments
 (0)