rishiswethan2

Untitled

Nov 28th, 2023
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.33 KB | None | 0 0
  1.  
  2. # ---------------------------------------------------------------------------------------------------------------------
  3. """
  4. typical house in London
  5. """
  6.  
  7. # property_price_initial = interest_adjusted_property_price = property_price = 500000  # in pounds
  8. #
  9. # interest_rate = 0.055
  10. # down_payment = 0.2
  11. # tenure = 15
  12. # yearly_savings_return = 0.06
  13. # property_price_appreciation = 0.04
  14. #
  15. # rent_percentage = 0.05  # rental yield
  16. # rent_maintenance_per = 0.1  # amount of the rent that goes to maintenance, property tax, etc.
  17. #
  18. # inflation = 0.03
  19.  
  20. # -------------------------------------------------------------------------------------------------------------------
  21. """
  22. typical house in Chennai
  23. """
  24.  
  25. property_price_initial = interest_adjusted_property_price = property_price = 12000000  # in rupees
  26.  
  27. interest_rate = 0.086
  28. down_payment = 0.2
  29. tenure = 15
  30. yearly_savings_return = 0.1
  31. property_price_appreciation = 0.07
  32.  
  33. rent_percentage = 0.03  # rental yield
  34. rent_maintenance_per = 0.07  # amount of the rent that goes to maintenance, property tax, etc.
  35.  
  36. inflation = 0.06
  37.  
  38. # ---------------------------------------------------------------------------------------------------------------------
  39. """
  40. Calculate the monthly loan payment, monthly rent, and the amount saved at the end of the tenure if we rent and saved the difference.
  41. """
  42.  
  43. # - calculate the monthly loan payment
  44. down_payment = property_price * down_payment
  45. interest = ((property_price - down_payment) * interest_rate)
  46. principal = (property_price - down_payment) / tenure
  47.  
  48. monthly_payment = (interest + principal) / 12
  49.  
  50. # - calculate the monthly rent
  51. rent = (property_price * rent_percentage) / 12
  52. rent_maintenance = rent * rent_maintenance_per  # amount lost to maintenance expenses every month by the landlord
  53.  
  54. print(f"\nDown payment: {down_payment}")
  55. print(f"Monthly payment: {round(monthly_payment)}")
  56. print(f"Yearly interest: {round(interest)}\n\n")
  57. print("__________________________________________________________________________________________________\n")
  58.  
  59. # - let's see how much we'll have at the end of the tenure if we rent and saved the difference
  60. amount_saved = 0
  61. total_interest_liability = 0
  62. break_even_reached = False
  63. break_even_point = 0
  64. for i in range(tenure):
  65.  
  66.     amount_saved += amount_saved * yearly_savings_return  # savings return every year
  67.     rent = (property_price * rent_percentage) / 12  # recalculate rent every year based on the property price
  68.     rent_maintenance = rent * rent_maintenance_per  # rent maintenance increase every year
  69.  
  70.     for j in range(12):
  71.         amount_saved += monthly_payment - rent + rent_maintenance  # amount saved every month
  72.  
  73.     print(f"Year {i + 1}:")
  74.     print(f"Amount saved by not paying EMI: {round(amount_saved)}")
  75.     print(f"Rent: {round(rent)}")
  76.     print(f"Rent maintenance: {round(rent_maintenance)}\n")
  77.  
  78.     property_price += property_price * property_price_appreciation  # property price increase every year
  79.  
  80.     # calculate the interest adjusted property price
  81.     total_interest_liability += interest
  82.     interest_adjusted_property_price = property_price - total_interest_liability
  83.  
  84.     print("property_price: ", round(property_price))
  85.     print("interest adjusted property_price: ", round(interest_adjusted_property_price), "\n\n\n")
  86.  
  87.     # check break even point
  88.     if amount_saved > interest_adjusted_property_price and not break_even_reached:
  89.         print(f"--- Break even point: {i + 1} years ---\n\n")
  90.         break_even_reached = True
  91.         break_even_point = i + 1
  92.  
  93. """
  94. Let's see how much we'll have at the end of the tenure if we rent and saved the difference or if we bought the house.
  95. """
  96.  
  97. print("__________________________________________________________________________________________________\n")
  98.  
  99. if not break_even_reached:
  100.     print("Break even point never reached\n\n")
  101.     difference = interest_adjusted_property_price - amount_saved
  102.     print(f"Total amount wasted by renting: {round(difference)}\n\n")
  103.  
  104. else:
  105.     print(f"Break even point reached in {break_even_point} years\n\n")
  106.     difference = amount_saved - interest_adjusted_property_price
  107.     print(f"Total amount saved by renting: {round(difference)}\n\n")
  108.  
  109. inflation_adjusted_difference = difference / ((1 + inflation) ** tenure)
  110. print(f"Inflation adjusted difference: {round(inflation_adjusted_difference)}\n\n")
  111.  
Advertisement
Add Comment
Please, Sign In to add comment