Taking vacation: Pull it together problem


#1

here's my code:

def hotel_cost(nights):

return nights * 140

def plane_ride_cost(city):
city = raw_input("Città da visitare? ")

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):
cost = 40
if days >= 7:
return days * cost - 50
elif days >= 3 or days > 3:
return days * cost - 20
return days * cost

def trip_cost(city, days):
return hotel_cost(days) + rental_car_cost(days)+ + plane_ride_cost(city)

print(str(trip_cost("Tampa", 10)) // i used str() becouse i had an ascii error

now i'm getting another error:

plane_ride_cost('Charlotte') raised an error: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)


#2

resolved..........................


#3

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