Indentation error driving me crazy!


#1

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 = datetime.now()

print "calculator is starting up"

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

sleep(1)

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..."
    sleep(1)
    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))
else 
      return "Error! Invalid shape selector specified. Exiting."

#2

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


#3

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