2016-04-26 85 views
1
import math 
# Program intro 
def main(): 
# float print functions for n, A, r 

n = float(input('How much time in years do you need to pay back the loan?')) 
A = float(input("What is the amount of money you would like to borrow in whole dollars $?")) 
r = float(input("What is your desired interest rate in a whole number?" 
P = (r + A)/(n * A) 

爲什麼是P =(R + A)/(N * A)一個語法錯誤:無效的語法爲什麼這是Python中無效的語法錯誤?

+4

你錯過閉幕前一行的括號。 – mgilson

回答

4
r = float(input("What is your desired interest rate in a whole number?" 
                    ^
                 Missing 2 parenthesis 

正確的路線將如下所示:

r = float(input("What is your desired interest rate in a whole number?")) 
+0

謝謝你一個愚蠢的錯誤! – VChocolate