-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathke_lab4_part2.py
More file actions
43 lines (24 loc) · 1.15 KB
/
Copy pathke_lab4_part2.py
File metadata and controls
43 lines (24 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ke_lab4_part2.py
# A program that computes the annual interest rate of a set varibale using a while loop
# by: Kody Ellis
amount = 1.00
continue_ask = "yes"
while (continue_ask != "no"):
year_counter = 0
interest_amount = float(raw_input("Enter the annual interest rate(as a percentage)? "))
real_interest_amount = interest_amount / 100.0
amount_double = amount * 2
#Since we're returning a yearly interger, then we will say the investment
#will double whenevr the investment goes over the double amount """
while (amount < amount_double):
amount = amount + amount*(real_interest_amount)
year_counter += 1
print "It will take", year_counter, "years for the investment to double."
#This is to make sure that the next answer we get will eiterh be "no" or "yes"
while(True):
continue_ask = raw_input("Do you want to continue (put yes/no)?")
if continue_ask == "yes" or continue_ask == "no":
break
else:
print "I'm sorry please input either yes or no"
print "END OF SESSION. Good bye!"