给出的错误对您来说有点误导,因为您的参数传递顺序错误。在
请求指示define a function called trip_cost that takes two arguments, city and days.
稍后您将添加第三个参数spending_moneyModify your trip_cost function definition. Add a third argument, spending_money.
您需要的结果函数是:def trip_cost(city,days,spending_money):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money
如果更改了参数顺序,则会出现如下错误:Oops, try again. trip_cost('Tampa', 7, 0) raised an error: unsupported operand type(s) for -: 'str' and 'int'
这是第6步。在
所以更改您的订单就可以了。
对于第7步,我尝试更改顺序,但也出现了以下错误:Oops, try again. trip_cost should take exactly three parameters: city, days, and spending_money (in that order).