I have hit the wall need help with "pull it together"


def hotel_cost(Days):
return Days * 140

def plane_ride_cost(city):
if city == 'Charlotte':
return 183
elif city == 'Tampa':
return 220
elif city == 'Pittsburgh':
return 222
elif city == 'Los Angeles':
return 475
return "you have enterd an invalid city name"

def rental_car_cost(days):
if days >= 7:
return (days * 40 - 50)
elif days >= 3 and days < 7:
return (days * 40 - 20)
return (days * 40)

def trip_cost(city,days):
return rental_car_cost(days) + plane_ride_cost(city) + hotel_cost(Days)
print trip_cost(Tampa, 10)


Yeah there's a few errors but try and tell us why you hit the wall. Makes it easier to start explaining things


i cant see any of the errors and when i submit my code it says: trip_cost('Tampa', 2) raised an error: global name 'Days' is not defined


and if you could point out my errors. it would help alot.


Ok, I'm not using the codecademy interface to test this, pain in the butt using it anyway, i avoid it like the plague.
There are plenty of python simulators on line that you can try out to test your code.
Assuming you have indented everything correctly ( You have done that ?? YES ? Very important in Python)
1) You need to make sure your variable names are exactly the same in the main code block
2) You can use different names when passing data to and from a function for the same variable that is being used in the main code block.
3) The Main code block is independent from the functions (or methods) code that you define in your program
Now using what I've just told you, review your code.