Create a python program that will implementing try, except and finally in the sample class below. class Investment: def __init__(self, principal, interest, nyears): self.principal = principal...

Create a python program that will implementing try, except and finally in the sample class below. class Investment: def __init__(self, principal, interest, nyears): self.principal = principal self.interest = interest self.nyears = nyears def value_after (self): x = (self.principal*((1+self.interest))**self.nyears) print (x) principal = int (input ("Principal: ")) interest = int (input ("Interest Rate: ")) nyears = int (input ("Number of years: ")) z = Investment (principal, interest, nyears) z.value_after ()
class Investment:<br>def _init__(self, principal, interest, nye ars):<br>self.principal = principal<br>self.interest = interest<br>self.nye ars = nyears<br>def value_after (self):<br>x = (self.principal*((I+self.interest))**self.nyears)<br>print (x)<br>%3D<br>%3D<br>%3D<br>principal = int (input (

Extracted text: class Investment: def _init__(self, principal, interest, nye ars): self.principal = principal self.interest = interest self.nye ars = nyears def value_after (self): x = (self.principal*((I+self.interest))**self.nyears) print (x) %3D %3D %3D principal = int (input ("Principal: ")) interest = int (input ("Interest Rate: ")) nye ars = int (input ("Number of ye ars: ")) z = Investment (principal, interest, nye ars) z.value_after ()

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here