Question: def main ( ) : print ( n ) # Welcome Message print ( Welcome , Please answer the prompts to find out

def main():
print("n)
# Welcome Message
print("Welcome, Please answer the prompts to find out your house cleaning cost.")
#Define prices for 4 different cleaning types
cleaning_prices
'Floors': 40,
'Windows': 50,
'Bathrooms': 60,
'Dusting' : 30
}
#Define house/room size cutoffs
smal1_rooms_cutoff =3
medium_rooms_cutoff =6
large_rooms_cutoff =9
#Define what the price will be based on different house sizes
small_house price =175
medium house price =250
large house price =300
#Prompt the User for the number of rooms and cleaning type
num_rooms = int(input("Enter the number of rooms in the house: "))
print("Select a cleaning type:")
for idx, cleaning_type in enumerate(cleaning_prices.keys(), start=1):
print (f"{idx}.{cleaning_type}")
cleaning_choice = int (input("Enter 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 num_rooms = small_rooms_cutoff:
house_size_price -= smal_ house_price
elif num_rooms =medium_rooms_cutoff:
house_size_price = medium_house_price
else:
house_size_price = large_house_price
selected_cleaning = list(cleaning_prices.keys())[cleaning_choice -1]
cleaning_cost = cleaning_prices[selected_cleaning]
#Calculate total cost
total_cost = house_size_price + cleaning_cost
#show the results
print(f"The cost of house cleaning for {num_rooms} rooms with {selected_cleaning} is ${total_cost}")
main()
Rewrite the python code adding in a function for the option of light cleaning or heavy cleaning
 def main(): print("n) # Welcome Message print("Welcome, Please answer the prompts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!