Objectives: I need to read cost and discount rate and number of year and calculate the time adjusted cost and time adjusted benefits and cumulative for both.
I receive this error:
Traceback (most recent call last):
File "D:\python\codetest\hw.py", line 3, in <module>
cost = eval(input("Enter Development cost :"))
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
When I remove eval
the code works fine.
#import numpy as np
cost = eval(input("Enter Development cost :"))
discrate = eval(input("Enter discount rate :"))
#operation cost list
opcost = []
#benifits list
benifits = []
#dicount rate list
#dicount rate list
discount=[]
#time adjusted cost
TAC = []
#time adjusted benifits
TAB = []
CTAC=[]
year = eval(input("Enter number of year "))
for i in range (year):
opcost.append(eval(input("Enter operation cost :")))
for i in range (year):
benifits.append(eval(input("Enter benifit for this year :")))
for i in range (year):
pvn = (1/pow(1+discrate,i))
# print (pvn)
discount.append(pvn)
for i in range (year):
TAC.append(discount[i] * opcost[i])
#print(TAC[i])
for i in range(year):
TAB.append(discount[i] * benifits[i]))
#CTAC = np.cumsum(TAC)
#for i in range (year):
# print(CTAC[i])