-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathint_calc_selector.py
28 lines (23 loc) · 1013 Bytes
/
int_calc_selector.py
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
#-----------------------------------------------------------------
# This program selects the mode type of interest:
# Continuous vs Discrete.
# It includes a check to make sure that the user only
# inputs either a 'D' or a 'C'.
# It then returns the valid entered kry.
# Auhtor: Erv
#------------------------------------------------------------------
def select_calculator():
print("Select between the mode of interest rates.")
print("Press 'D' to use compound interest (discrete).")
print("Press 'C' to use continuous interest.\n")
print("--------------------------------------------------------------")
choice = input(str("D or C:"))
choice = choice.upper()
while choice !="D" and choice != "C":
print("Invalid input, try again.")
print("Press 'D' to use compound interest (discrete).")
print("Press 'C' to use continuous interest.\n")
print("--------------------------------------------------------------")
choice = input(str("D or C: "))
choice = choice.upper()
return choice