Question: Turn this code into an HTML file. # User is asked if they have enough money to purchase an item. name = input (
Turn this code into an HTML file. # User is asked if they have enough money to purchase an item.
name inputHello there! Please enter your name:
budget inputfHi there, name How much is your budget:
printfIt looks like your budget is $budget Is that correct name
Q inputPlease enter Yes or No:
Jif Q 'Yes' or Q 'Yes' or Q 'YES':
itemcost inputHow much does the item that you plan to purchase cost?
# Function that is used to print out a message to the user stating they have enough funding.
def congratstext:
printfCongratulations name You have enough money to purchase your product!"
congratstext
# Function that is used to check if the user has a remaining balance after the purchase is completed.
def budgetanalysis:
if budget itemcost:
remaining intbudget intitemcost
printfYou will have $remaining leftover."
elif budget itemcost:
printYou may want to consider saving more money."
budgetanalysis
else:
printfPlease restart name
print Thank you!"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
