4/7 help


#1

here's my code:

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


#2

Can you describe your problem a little more ?


#3

sure here is the error

Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days.


#4

here is my code

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


#5

here is the error

Oops, try again. It looks like rental_car_cost returns None instead of the correct amount (40) for 1 days.


#6

alright i fixed it now
:laughing::laughing:


#7

Could we see your code so other users may look at it for guidance?


#8

i cant figure it out how did you do it? :disappointed_relieved: i've tried most of the codes people are saying to do and its not working for some reason. please help me with this thanks :smile_cat:


#9

sorry it took me so long to respond here is the code

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
def rental_car_cost(days):
price = days*40
if days >= 7:
price = (days*40) - 50
elif days >= 3:
price = (days*40) - 20
return price

I hope this helps anyone who needs it :slight_smile::slight_smile:


#10

thanks it helps me to