Help, what wrong (getting there)


#1

ef hotel_cost(nights):
return 140*nights

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

>> File "python", line 8
elif city=="Tampa":
   ^

SyntaxError: invalid syntax


#2

Make sure that indentation is done correctly.

header of function on 0-indentation
If,elif's should be indented by 4-spaces bars with respect to function's header.
The code inside if/elif's should be indented 4-space bar with respect to if/eif's.

(Im considering that first line of this program is copy-paste mistake

ef hotel_cost(nights)
)


#3

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