my current code:
def car_wash_service(base_price, dictionary, service1, service2):
total_price = base_price
service_list = {service2, service1}
print('ZyCar Wash')
print(f'Base car wash -- ${base_price}')
for service in service_list:
if service in dictionary.keys():
print(f'{service} -- ${dictionary[service]}')
total_price += dictionary[service]
print('----')
print(f'Total price: ${total_price}')
return total_price
if __name__ == "__main__":
services = {'Air freshener': 1, 'Rain repellent': 2, 'Tire shine': 2, 'Wax': 3, 'Vacuum': 5}
base_wash = 10
total = 0
service_choice1 = input()
service_choice2 = input()
car_wash_service(base_wash, services, service_choice1, service_choice2)
my error:
1:Compare outputkeyboard_arrow_up
0 / 2
Output differs. See highlights below. Special character legend
Input
Tire shine Wax
Your output starts with
ZyCar Wash Base car wash β $10 Wax β $3 Tire shine β $2 ---- Total price: $15
Expected output starts with
ZyCar Wash Base car wash β $10 Tire shine β $2 Wax β $3 ---- Total price: $15
2:Compare outputkeyboard_arrow_up
3 / 3
Input
Rain repellent -
Your output
ZyCar Wash Base car wash β $10 Rain repellent β $2 ---- Total price: $12
3:Compare outputkeyboard_arrow_up
3 / 3
Input
Vacuum Air freshener
Your output
ZyCar Wash Base car wash β $10 Vacuum β $5 Air freshener β $1 ---- Total price: $16
4:Compare outputkeyboard_arrow_up
2 / 2
Input
Your output correctly ends with
ZyCar Wash Base car wash β $10 ---- Total price: $10
5:Unit testkeyboard_arrow_up
2 / 2
car_wash_service() with the first example
Your output
ZyCar Wash Base car wash β $10 ---- Total price: $10
6:Unit testkeyboard_arrow_up
2 / 2
car_wash_service() with the second example
Your output
ZyCar Wash Base car wash β $13 Tire shine β $16 Air freshener β $20 ---- Total price: $49