Question: import platform vers = platform.python_version() assert vers[0] == '3', You must use Python 3, +vers+ is not acceptable print(Python 3 confirmed.) amt = int(str(input(Enter the

import platform

vers = platform.python_version() assert vers[0] == '3', "You must use Python 3, "+vers+" is not acceptable" print("Python 3 confirmed.")

amt = int(str(input("Enter the loan amount in dollars: "))) n = int(input("Enter the loan duration in months: ")) r = int(input("Enter the % annual interest rate: "))/100/12 payment = str(r*amt/1 - (1+r)**(-n)) print("Your monthly payment is: " + round(payment,2)) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The code runs but I keep getting this "TypeError: type str doesn't define __round__ method" How do I fix it?

The code should give something like this :

Enter the loan amount in dollars: 100

Enter the loan duration in months: 10

Enter the % annual interest rate: 12

Your monthly payment is: 10.56

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!