Skip to content
Permalink
Browse files
Update main.py
  • Loading branch information
dacostag committed May 5, 2020
1 parent 2003423 commit cf90c1db45c13e3c25f4215736cc4879c417d8ce
Showing 1 changed file with 6 additions and 4 deletions.
10 main.py
@@ -14,12 +14,12 @@ class Calculator:

def error(self):
if self.question_number == 1:
if self.account <= 0:
if self.account < 0:
return True
else:
return False
if self.question_number == 2:
if self.monthly <= 0:
if self.monthly < 0:
return True
else:
return False
@@ -45,15 +45,15 @@ class Calculator:

if self.question_number == 2:
print("How much money are you planning on investing monthly? ")
self.monthly = float(input("Enter amount: "))
self.monthly = int(input("Enter amount: "))
if self.error():
self.asker()
else:
self.question_number += 1

if self.question_number == 3:
print("What's the yearly interest rate of this investment?")
self.rate = int(input('Enter interest rate in percentage: '))
self.rate = float(input('Enter interest rate in percentage: '))
if self.error():
self.asker()
else:
@@ -69,3 +69,5 @@ c.asker()





0 comments on commit cf90c1d

Please sign in to comment.