Wats wrong?/


#1


def hotel_cost(nights):
return 140*nights
def plane_ride_cost(city):
return city
if "Charlotte":
return 183
elif "Tampa":
return 220
elif "Pittsburgh":
return 222
elif "Los Angeles":
return 475


Replace this line with your code.


#2

def plane_ride_cost(city):
    return city

why are you returing city?

remember function ends at that moment whenever a return occurs.

also make sure you've proper indentation


#3

It's been a while since I've messed around in Python so maybe @rcodeman can give me confirmation..
Your if/elif statements don't seem correct. For ex:

if "Charlotte"

Shouldn't that be

if city == "Charlotte"

Or are other languages clouding my mind?

**Ps: for @rcodeman if you know anything about rails please check out my question, thanks. **


#4

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