Multiple Parameters / Does not print the value

Hi,

can anyone tells me why the following code is not printed out?
I got all green tick boxes but there was nothing printed out.

def calculate_expenses(plane_ticket_price, car_rental_rate, hotel_rate, trip_time):
 car_rental_total=car_rental_rate*trip_time
 hotel_total=hotel_rate*trip_time-10
 print(car_rental_total+hotel_total+plane_ticket_price)

 calculate_expenses(200, 100, 100, 5)

I would follow pep8 style guide, and use 4 spaces for indention:

def calculate_expenses(plane_ticket_price, car_rental_rate, hotel_rate, trip_time):
    car_rental_total=car_rental_rate*trip_time
    hotel_total=hotel_rate*trip_time-10
    print(car_rental_total+hotel_total+plane_ticket_price)

    calculate_expenses(200, 100, 100, 5)

Then its a lot easier to see that your function call is nested within the body of your function

I followed your advise but the code is still not printed out to the console.
Do you have any other ideas why it does not work?

I merely fixed the indention to be compliant with the pep8 style guide.

Then I explained what the problem with your code is:

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.