Code:
housePrice = input("What's the price of House? ")
is_goodCredit = input("Does buyer have good credit? ")
if is_goodCredit:
downPayment = 0.1 * float(housePrice)
else:
downPayment = 0.2 * float(housePrice)
print(f"Down payment will be {downPayment}")
The VS Code terminal:
PS C:\Users\bandh> & C:/Users/bandh/AppData/Local/Programs/Python/Python311/python.exe c:/Users/bandh/Desktop/Untitled-1.py
What's the price of House? 1000
Does buyer have good credit? true
Down payment will be 100.0
PS C:\Users\bandh> & C:/Users/bandh/AppData/Local/Programs/Python/Python311/python.exe c:/Users/bandh/Desktop/Untitled-1.py
What's the price of House? 1000
Does buyer have good credit? false
Down payment will be 100.0
As you can see when entering "false" the answer should have been 200 but it is showing 100. Why?