plane_ride_cost('Charlotte') raised an error: global name 'nights' is not defined


#1



Replace this line with your code.


#2

Without seeing your code I'm going to guess that the call to hotel_cost() from within trip_cost() contains an undefined variable.

... + hotel_cost(nights) + ...

The local variable in trip_cost() is days. The local variable in hotel_cost() may be nights, but that is local. days is passed in.


#3

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