Added code for lecture 2026-11-10
This commit is contained in:
parent
5b630435ae
commit
07b9e54bf0
52 changed files with 1248 additions and 1 deletions
16
lecture20261110/if/if07.py
Normal file
16
lecture20261110/if/if07.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
# consider the following line from the autoloan program:
|
||||
|
||||
principal = float(input("Enter a value for the principal: "))
|
||||
if(principal < 5000.) or (principal >120000.00):
|
||||
print(f"The loan value {principal} is outside the allowed limits.")
|
||||
exit(-1)
|
||||
|
||||
rate = float(input("Enter a value for the interest rate (7 for 7%): "))
|
||||
|
||||
numberOfYears = float(input("Enter the number of years for the loan: "))
|
||||
|
||||
print(f"You entered the principal value {principal}")
|
||||
print(f"You entered the rate value {rate}%")
|
||||
print(f"You entered the loan term value {numberOfYears} years")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue