Mar-31-2019, 10:04 AM
Greetings. I am working on creating a calculator in python. My objective is to create a basic calculator to return the repair value and estimated profit. I keep getting error messages. Here is my code below along with the error message.
print("Welcome to Value Estimator") Value_1 = int(input("Please enter the value of target home:")) a1 = int(input("Please enter the value of the sales price of home #1:")) a2 = int(input("Please enter the sales price of home #2:")) a3 = int(input("Please enter the sales price of home #3:")) a4 = int(input("Please enter the sales price of home #4:")) a5 = int(input("Please enter the sales price of home #5:")) avg_sales_price = (a1 + a2 + a3 + a4 + a5)/ 5 print("Average sales price for homes in area is", avg_sales_price) ARV = str(avg_sales_price) print("The ARV for this home:" + ARV) def repair_cost(): if Value_1 <= 30000: repair_cost = (60000) - (Value_1) elif Value_1 >= 30000: repair_cost = (Value_1) + 17000 repair_cost(Value_1) profit = str(avg_sales_price) - str(Value_1) - str(repair_cost)
Error:Traceback (most recent call last):
File "C:/Users/Cupid/AppData/Local/Programs/Python/Python37/spreadsheet.py", line 33, in <module>
repair_cost(Value_1)
TypeError: repair_cost() takes 0 positional arguments but 1 was given