Value Estimator Calculator - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Value Estimator Calculator (/thread-17234.html) |
Value Estimator Calculator - jaycuff13 - Apr-03-2019 Hello. I am working on value estimator in python. Towards the end of my script I am trying to create a rating systems based on the the total investment which = Repair_Cost + Sales price. I tried to def home_rating and then use if statements to no avail. The program works still but doesnt provide the final output I'm looking for. Thank you in advance for your help! 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 calc_repair_cost(Value_1): if Value_1 <= 30000: repair_cost = (60000) - (Value_1) elif Value_1 >= 30000: repair_cost = 20000 return repair_cost repair_cost = calc_repair_cost(Value_1) print("The repair cost for the home is:", + repair_cost) total_investment = Value_1 + repair_cost def calc_home_rating(Value_1): if total_investment >= 60000: home_rating = False elif total_investment <= 60000: home_rating = True return home_rating home_rating = calc_home_rating if (home_rating == True): print("This home is worth a look") elif home_rating == False: print("This is not a good home") RE: Value Estimator Calculator - j.crater - Apr-03-2019 Hello, after a quick glance I see 2 issues: def calc_home_rating(Value_1): if total_investment >= 60000: home_rating = False elif total_investment <= 60000: home_rating = True return home_ratingYou pass Value_1 to function, but it is never used in function's body. home_rating = calc_home_ratingcalc_home_rating is a function, so you need to call it with braces and argument calc_home_rating(argument) |