Skip to content

Commit ebe2229

Browse files
committed
Update ex036.py
1 parent 3ca46c2 commit ebe2229

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ex036.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#Write a program to approve a bank loan for the purchase of a house. Ask the buyer for the value of the house, the
22
# buyer's salary and in how many years he will pay it off. The monthly payment cannot exceed 30% of the salary or
33
# else the loan will be denied.
4+
45
house = float(input('What is the value of the house you want to buy in R$:'))
56
salary = float(input('What is your salary in R$:'))
67
time = float(input('How many years do you want to pay off the house?'))
78
installment = house / (time * 12)
89
condition = salary * 0.30
9-
print(f'To pay for a house R${house} in {time} years.')
10-
print(f'The installment will be of R${installment}.')
10+
print(f'To pay for a house R${house:.2f} in {time:.0f} years.')
11+
print(f'The installment will be of R${installment:.2f}.')
1112
if installment <= condition:
1213
print('Congratulations your loan was approved!')
1314
else:
1415
print('Try adding one more income.')
1516

1617
'''
17-
# code "V
18+
# code my friend "V
1819
house = float(input('House value (R$): '))
1920
salary = float(input('Salary (R$): '))
2021
time = int(input('Years to pay: '))

0 commit comments

Comments
 (0)