Indentation error driving me crazy!


Hi guys,

I've no clue what's going on. I don't understand why exactly line 29 when the 2 lines prior (27 & 28) are indented in the same way.

Much much thanks !

  Line 29
    area = (0.5) * base * height
IndentationError: unexpected indent

print "this program is awesome!"

from math import pi
from time import sleep
from datetime import datetime

now =

print "calculator is starting up"

print "Current time: %s/%s/%s  %s:%s" % (now.month,, now.year, now.hour, now.minute)


hint = "Don't forget to include the correct units! \nExiting..."

option = raw_input("Enter C for Circle or T for Triangle:")
option = option.upper()

if option == "C":
    radius = float(raw_input("Enter radius:"))
    area = pi * radius ** 2
    print "The pie is baking..."
    print ("Area: %.2f. \n%s" % (area,hint))
elif option == "T":
        base = float(raw_input("Enter a base"))
        height = float(raw_input("Enter a height"))
  	area = (0.5) * base * height
        print = "Uni Bi Tri..."
        print ("Area: %.2f. \n%s" % (area,hint))
      return "Error! Invalid shape selector specified. Exiting."


They're not indented the same way. You're mixing tabs and spaces


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