Question: def main ( ) : print ( n ) # Welcome Message print ( Welcome , Please answer the prompts to find out
def main:
printn
# Welcome Message
printWelcome Please answer the prompts to find out your house cleaning cost."
#Define prices for different cleaning types
cleaningprices
'Floors':
'Windows':
'Bathrooms':
'Dusting' :
#Define houseroom size cutoffs
smalroomscutoff
mediumroomscutoff
largeroomscutoff
#Define what the price will be based on different house sizes
smallhouse price
medium house price
large house price
#Prompt the User for the number of rooms and cleaning type
numrooms intinputEnter the number of rooms in the house:
printSelect a cleaning type:"
for idx, cleaningtype in enumeratecleaningprices.keys start:
print fidxcleaningtype
cleaningchoice int inputEnter the number corresponding to the cleaning type:
#Calculate cost using if statements based on what the user selected for cleaning type and rooms that were input
if numrooms smallroomscutoff:
housesizeprice smal houseprice
elif numrooms mediumroomscutoff:
housesizeprice mediumhouseprice
else:
housesizeprice largehouseprice
selectedcleaning listcleaningprices.keyscleaningchoice
cleaningcost cleaningpricesselectedcleaning
#Calculate total cost
totalcost housesizeprice cleaningcost
#show the results
printfThe cost of house cleaning for numrooms rooms with selectedcleaning is $totalcost
main
Rewrite the python code adding in a function for the option of light cleaning or heavy cleaning
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
