Answer:
Step-by-step explanation:
Here's the Python program that takes two inputs, current price and last month's price, and outputs a summary listing the price, the change since last month, and the estimated monthly mortgage:
current_price = int(input())
last_months_price = int(input())
price_diff = current_price - last_months_price
mortgage_estimate = (current_price * 0.051) / 12
print(f'This house is ${current_price}.')
print(f'The change is ${price_diff}.')
print(f'The estimated monthly mortgage is ${mortgage_estimate:.2f}.')
The program starts by reading the current price and last month's price from the user using the input() function and converting them to integers using the int() function. Then, it calculates the difference between the current price and last month's price and stores it in the price_diff variable.
Next, it calculates the estimated monthly mortgage using the formula given in the problem statement and stores it in the mortgage_estimate variable.
Finally, it prints out the summary using the print() function and formatted strings (f-strings) that display the values of the variables with two digits after the decimal point. Note that the \\ character is not necessary because the print() function automatically adds a newline character at the end of each line.
Sample output for current price=200000 and last month's price=210000:
This house is $200000.
The change is $-10000.
The estimated monthly mortgage is $850.00.