Help with IndentationError: Unexpected Indent


#1

Hello, so i’m working on exercise 4: Transportation in the Python course. I’m getting an indent error that i’m not sure why… Hopefully you can help me. The error is:

  File "python", line 7
    elif city == "Tampa":
    ^
IndentationError: unexpected indent```

Here’s the code:

def 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

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

Thanks again.

#2

It looks like mixed tabs and spaces. Replace the tabs with spaces so all the indents are the same.


#3

You’re absolutely right, thank you very much.