python Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (current_price * 0.051) / 12.

Respuesta :

Answer:

current_price = int(input("Enter current price: "))

last_months_price = int(input("Enter last month's price: "))

print("This house is $%d. The change is a $%d since last month." % (current_price, current_price - last_months_price))

print("The estimated monthly mortgage is $%d." % int(current_price*0.045/12))

Explanation:

- Ask the user to enter the values for current_price and last_months_price.

- Print the current price.

- Calculate change from last month (current_price - last_months_price) and print it.

- Calculate the mortgage (using given formula (current_price * 0.051) / 12) and print it.

'{:.0f}'.format(current_price),end='.')

print(' ''The change is', '

'{:.0f}'.format(finalprice), 'since last month.')

print('The estimated monthly mortgage is', '

'{:.2f}'.format(monthly),end='.''\n')

Explanation: